mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 06:25:30 +00:00
ICU-6633 warnings fix
X-SVN-Rev: 27600
This commit is contained in:
parent
aa4f67d150
commit
18fa32ded0
5 changed files with 526 additions and 501 deletions
File diff suppressed because it is too large
Load diff
|
@ -80,7 +80,7 @@ uplug_getPlugInternal(int32_t n);
|
|||
* @internal - Internal use only.
|
||||
*/
|
||||
U_INTERNAL const char* U_EXPORT2
|
||||
uplug_getPluginFile();
|
||||
uplug_getPluginFile(void);
|
||||
|
||||
/** @} */
|
||||
|
||||
|
|
|
@ -221,7 +221,8 @@ uplug_getPlugLevel(UPlugData *plug);
|
|||
* @return the lowest level of plug which can currently load
|
||||
* @internal ICU 4.4 Technology Preview
|
||||
*/
|
||||
U_CAPI UPlugLevel U_EXPORT2 uplug_getCurrentLevel();
|
||||
U_CAPI UPlugLevel U_EXPORT2
|
||||
uplug_getCurrentLevel(void);
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
@ -45,6 +45,15 @@ static UOption options[]={
|
|||
/*6*/ UOPTION_DEF("cleanup", 'K', UOPT_NO_ARG),
|
||||
};
|
||||
|
||||
static UErrorCode initStatus = U_ZERO_ERROR;
|
||||
static UBool icuInitted = FALSE;
|
||||
|
||||
static void do_init() {
|
||||
if(!icuInitted) {
|
||||
u_init(&initStatus);
|
||||
icuInitted = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Print the current platform
|
||||
|
@ -104,9 +113,9 @@ void cmd_version(UBool noLoad)
|
|||
printf("Cygwin: CYGWINMSVC\n");
|
||||
#endif
|
||||
printf("ICUDATA: %s\n", U_ICUDATA_NAME);
|
||||
u_init(&status);
|
||||
do_init();
|
||||
printf("Data Directory: %s\n", u_getDataDirectory());
|
||||
printf("ICU Initialization returned: %s\n", u_errorName(status));
|
||||
printf("ICU Initialization returned: %s\n", u_errorName(initStatus));
|
||||
printf( "Default locale: %s\n", uloc_getDefault());
|
||||
{
|
||||
UErrorCode subStatus = U_ZERO_ERROR;
|
||||
|
@ -169,6 +178,9 @@ void cmd_cleanup()
|
|||
void cmd_listplugins() {
|
||||
int32_t i;
|
||||
UPlugData *plug;
|
||||
|
||||
do_init();
|
||||
printf("ICU Initialized: u_init() returned %s\n", u_errorName(initStatus));
|
||||
|
||||
printf("Plugins: \n");
|
||||
printf( "# %6s %s \n",
|
||||
|
|
|
@ -24,6 +24,19 @@
|
|||
#include "unicode/uclean.h"
|
||||
#include "cmemory.h"
|
||||
|
||||
/**
|
||||
* Prototypes
|
||||
*/
|
||||
#define DECLARE_PLUGIN(x) U_CAPI UPlugTokenReturn U_EXPORT2 x (UPlugData *data, UPlugReason reason, UErrorCode *status)
|
||||
|
||||
DECLARE_PLUGIN(myPlugin);
|
||||
DECLARE_PLUGIN(myPluginLow);
|
||||
DECLARE_PLUGIN(myPluginFailQuery);
|
||||
DECLARE_PLUGIN(myPluginFailToken);
|
||||
DECLARE_PLUGIN(myPluginBad);
|
||||
DECLARE_PLUGIN(myPluginHigh);
|
||||
DECLARE_PLUGIN(debugMemoryPlugin);
|
||||
|
||||
/**
|
||||
* A simple, trivial plugin.
|
||||
*/
|
||||
|
@ -141,25 +154,30 @@ UPlugTokenReturn U_EXPORT2 myPluginHigh (
|
|||
|
||||
/* Debug Memory Plugin (see hpmufn.c) */
|
||||
static void * U_CALLCONV myMemAlloc(const void *context, size_t size) {
|
||||
void *retPtr = (void *)malloc(size);
|
||||
fprintf(stderr, "MEM: malloc(%d) = %p\n", size, retPtr);
|
||||
return retPtr;
|
||||
void *retPtr = (void *)malloc(size);
|
||||
(void)context; /* unused */
|
||||
fprintf(stderr, "MEM: malloc(%d) = %p\n", (int32_t)size, retPtr);
|
||||
return retPtr;
|
||||
}
|
||||
|
||||
static void U_CALLCONV myMemFree(const void *context, void *mem) {
|
||||
free(mem);
|
||||
fprintf(stderr, "MEM: free(%p)\n", mem);
|
||||
(void)context; /* unused */
|
||||
|
||||
free(mem);
|
||||
fprintf(stderr, "MEM: free(%p)\n", mem);
|
||||
}
|
||||
|
||||
static void * U_CALLCONV myMemRealloc(const void *context, void *mem, size_t size) {
|
||||
void *retPtr;
|
||||
(void)context; /* unused */
|
||||
|
||||
|
||||
if(mem==NULL) {
|
||||
retPtr = NULL;
|
||||
} else {
|
||||
retPtr = realloc(mem, size);
|
||||
}
|
||||
fprintf(stderr, "MEM: realloc(%p, %d) = %p\n", mem, size, retPtr);
|
||||
fprintf(stderr, "MEM: realloc(%p, %d) = %p\n", mem, (int32_t)size, retPtr);
|
||||
return retPtr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue