From d59294a00e5c1a2fe7d907955d1b405e3934ea28 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 5 Aug 2015 22:24:49 +0200 Subject: [PATCH] Header conformance fixes Identifiers starting with __ are reserved for the system - user code (including non-system libraries) must not define them. A function which takes no parameters is declared with "(void)". In C, an empty parameter list means that any number of parameters with unspecified types is allowed, which is not what we want in this case. Another reason to fix this is that compilers often warn if this legacy feature is used, which is bothersome for API users. Additionally, use an opaque struct as underlying type for uchardet_t. This facilitates type-checking, as it's harder to confuse with other types, especially in C. This is not strictly a conformance issue, but still a nice change. Note that this is neither an API or an ABI change. --- src/uchardet.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/uchardet.h b/src/uchardet.h index 533666a..0ce738f 100644 --- a/src/uchardet.h +++ b/src/uchardet.h @@ -34,8 +34,8 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#ifndef ___UCHARDET_H___ -#define ___UCHARDET_H___ +#ifndef UCHARDET_H___ +#define UCHARDET_H___ #ifdef __cplusplus extern "C" { @@ -43,13 +43,13 @@ extern "C" { #include -typedef void * uchardet_t; +typedef struct uchardet * uchardet_t; /** * Create an encoding detector. * @return a handle of a instance of uchardet */ -uchardet_t uchardet_new(); +uchardet_t uchardet_new(void); /** * Delete an encoding detector.