Skip to content

Commit

Permalink
ICU-21170 Fix function prototypes
Browse files Browse the repository at this point in the history
  • Loading branch information
eldruin authored and jefgen committed Jun 25, 2020
1 parent 8727c56 commit de0306d
Show file tree
Hide file tree
Showing 5 changed files with 103 additions and 103 deletions.
46 changes: 23 additions & 23 deletions icu4c/source/common/putil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ typedef struct DefaultTZInfo {
* It is currently use to compare two TZ files.
*/
static UBool compareBinaryFiles(const char* defaultTZFileName, const char* TZFileName, DefaultTZInfo* tzInfo) {
FILE* file;
FILE* file;
int64_t sizeFile;
int64_t sizeFileLeft;
int32_t sizeFileRead;
Expand Down Expand Up @@ -1044,7 +1044,7 @@ static char* searchForTZFile(const char* path, DefaultTZInfo* tzInfo) {
#endif

U_CAPI void U_EXPORT2
uprv_tzname_clear_cache()
uprv_tzname_clear_cache(void)
{
#if defined(CHECK_LOCALTIME_LINK) && !defined(DEBUG_SKIP_LOCALTIME_LINK)
gTimeZoneBufferPtr = NULL;
Expand Down Expand Up @@ -1091,10 +1091,10 @@ uprv_tzname(int n)
&& uprv_strcmp(tzid, TZ_ENV_CHECK) != 0
#endif
) {
/* The colon forces tzset() to treat the remainder as zoneinfo path */
if (tzid[0] == ':') {
tzid++;
}
/* The colon forces tzset() to treat the remainder as zoneinfo path */
if (tzid[0] == ':') {
tzid++;
}
/* This might be a good Olson ID. */
skipZoneIDPrefix(&tzid);
return tzid;
Expand All @@ -1115,7 +1115,7 @@ uprv_tzname(int n)
int32_t tzZoneInfoTailLen = uprv_strlen(TZZONEINFOTAIL);
gTimeZoneBuffer[ret] = 0;
char * tzZoneInfoTailPtr = uprv_strstr(gTimeZoneBuffer, TZZONEINFOTAIL);

if (tzZoneInfoTailPtr != NULL
&& isValidOlsonID(tzZoneInfoTailPtr + tzZoneInfoTailLen))
{
Expand Down Expand Up @@ -1445,7 +1445,7 @@ static void setTimeZoneFilesDir(const char *path, UErrorCode &status) {
#endif
}

#define TO_STRING(x) TO_STRING_2(x)
#define TO_STRING(x) TO_STRING_2(x)
#define TO_STRING_2(x) #x

static void U_CALLCONV TimeZoneDataDirInitFn(UErrorCode &status) {
Expand Down Expand Up @@ -1552,7 +1552,7 @@ static const char *uprv_getPOSIXIDForCategory(int category)
{
/* Maybe we got some garbage. Try something more reasonable */
posixID = getenv("LC_ALL");
/* Solaris speaks POSIX - See IEEE Std 1003.1-2008
/* Solaris speaks POSIX - See IEEE Std 1003.1-2008
* This is needed to properly handle empty env. variables
*/
#if U_PLATFORM == U_PF_SOLARIS
Expand All @@ -1563,7 +1563,7 @@ static const char *uprv_getPOSIXIDForCategory(int category)
if (posixID == 0) {
posixID = getenv(category == LC_MESSAGES ? "LC_MESSAGES" : "LC_CTYPE");
if (posixID == 0) {
#endif
#endif
posixID = getenv("LANG");
}
}
Expand Down Expand Up @@ -1671,7 +1671,7 @@ The leftmost codepage (.xxx) wins.
// (The "C"/"POSIX" case is handled in uprv_getPOSIXIDForCategory())
uprv_strcpy(correctedPOSIXLocale, "en_US_POSIX");
}

/* Note that we scan the *uncorrected* ID. */
const char *p;
if ((p = uprv_strrchr(posixID, '@')) != nullptr) {
Expand Down Expand Up @@ -2092,7 +2092,7 @@ int_getDefaultCodepage()
#endif
// Special case for UTF-8
if (codepageNumber == 65001)
{
{
return "UTF-8";
}
// Windows codepages can look like windows-1252, so format the found number
Expand Down Expand Up @@ -2285,7 +2285,7 @@ u_getVersion(UVersionInfo versionArray) {
}

/**
* icucfg.h dependent code
* icucfg.h dependent code
*/

#if U_ENABLE_DYLOAD && HAVE_DLOPEN && !U_PLATFORM_USES_ONLY_WIN32_API
Expand Down Expand Up @@ -2345,37 +2345,37 @@ uprv_dlsym_func(void *lib, const char* sym, UErrorCode *status) {
U_INTERNAL void * U_EXPORT2
uprv_dl_open(const char *libName, UErrorCode *status) {
HMODULE lib = NULL;

if(U_FAILURE(*status)) return NULL;

lib = LoadLibraryA(libName);

if(lib==NULL) {
*status = U_MISSING_RESOURCE_ERROR;
}

return (void*)lib;
}

U_INTERNAL void U_EXPORT2
uprv_dl_close(void *lib, UErrorCode *status) {
HMODULE handle = (HMODULE)lib;
if(U_FAILURE(*status)) return;

FreeLibrary(handle);

return;
}

U_INTERNAL UVoidFunction* U_EXPORT2
uprv_dlsym_func(void *lib, const char* sym, UErrorCode *status) {
HMODULE handle = (HMODULE)lib;
UVoidFunction* addr = NULL;

if(U_FAILURE(*status) || lib==NULL) return NULL;

addr = (UVoidFunction*)GetProcAddress(handle, sym);

if(addr==NULL) {
DWORD lastError = GetLastError();
if(lastError == ERROR_PROC_NOT_FOUND) {
Expand All @@ -2384,7 +2384,7 @@ uprv_dlsym_func(void *lib, const char* sym, UErrorCode *status) {
*status = U_UNSUPPORTED_ERROR; /* other unknown error. */
}
}

return addr;
}

Expand Down
6 changes: 3 additions & 3 deletions icu4c/source/common/putilimp.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ U_INTERNAL UBool U_EXPORT2 uprv_mul32_overflow(int32_t a, int32_t b, int32_t* re
* Return the default codepage for this platform and locale.
* This function can call setlocale() on Unix platforms. Please read the
* platform documentation on setlocale() before calling this function.
* @return the default codepage for this platform
* @return the default codepage for this platform
* @internal
*/
U_INTERNAL const char* U_EXPORT2 uprv_getDefaultCodepage(void);
Expand All @@ -377,7 +377,7 @@ U_INTERNAL const char* U_EXPORT2 uprv_getDefaultCodepage(void);
/**
* Please use uloc_getDefault() instead.
* Return the default locale ID string by querying the system, or
* zero if one cannot be found.
* zero if one cannot be found.
* This function can call setlocale() on Unix platforms. Please read the
* platform documentation on setlocale() before calling this function.
* @return the default locale ID string
Expand Down Expand Up @@ -441,7 +441,7 @@ U_INTERNAL const char* U_EXPORT2 uprv_tzname(int n);
* Reset the global tzname cache.
* @internal
*/
U_INTERNAL void uprv_tzname_clear_cache();
U_INTERNAL void uprv_tzname_clear_cache(void);

/**
* Get UTC (GMT) time measured in milliseconds since 0:00 on 1/1/1970.
Expand Down
6 changes: 3 additions & 3 deletions icu4c/source/common/ucnv_bld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ static UBool gDefaultConverterContainsOption;
static const char DATA_TYPE[] = "cnv";

/* ucnv_flushAvailableConverterCache. This is only called from ucnv_cleanup().
* If it is ever to be called from elsewhere, synchronization
* If it is ever to be called from elsewhere, synchronization
* will need to be considered.
*/
static void
Expand Down Expand Up @@ -262,7 +262,7 @@ static UBool U_CALLCONV ucnv_cleanup(void) {
}

U_CAPI void U_EXPORT2
ucnv_enableCleanup() {
ucnv_enableCleanup(void) {
ucln_common_registerCleanup(UCLN_COMMON_UCNV, ucnv_cleanup);
}

Expand Down Expand Up @@ -1309,7 +1309,7 @@ ucnv_setDefaultName(const char *converterName) {

/* The close may make the current name go away. */
ucnv_close(cnv);

/* reset the converter cache */
u_flushDefaultConverter();
}
Expand Down
8 changes: 4 additions & 4 deletions icu4c/source/common/ucnv_bld.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ typedef struct UConverterImpl UConverterImpl;

typedef struct UConverterStaticData { /* +offset: size */
uint32_t structSize; /* +0: 4 Size of this structure */
char name

char name
[UCNV_MAX_CONVERTER_NAME_LENGTH]; /* +4: 60 internal name of the converter- invariant chars */

int32_t codepage; /* +64: 4 codepage # (now IBM-$codepage) */
Expand All @@ -80,7 +80,7 @@ typedef struct UConverterStaticData { /* +offset: size */

uint8_t subChar[UCNV_MAX_SUBCHAR_LEN]; /* +72: 4 [note: 4 and 8 byte boundary] */
int8_t subCharLen; /* +76: 1 */

uint8_t hasToUnicodeFallback; /* +77: 1 UBool needs to be changed to UBool to be consistent across platform */
uint8_t hasFromUnicodeFallback; /* +78: 1 */
uint8_t unicodeMask; /* +79: 1 bit 0: has supplementary bit 1: has single surrogates */
Expand Down Expand Up @@ -289,7 +289,7 @@ ucnv_swap(const UDataSwapper *ds,
UErrorCode *pErrorCode);

U_CAPI void U_EXPORT2
ucnv_enableCleanup();
ucnv_enableCleanup(void);

#endif

Expand Down
Loading

0 comments on commit de0306d

Please sign in to comment.