ICU-837 Fixed library data size and formatting/parsing of large uint and signed numbers
X-SVN-Rev: 3571
This commit is contained in:
parent
9232b4b1e4
commit
009189b930
@ -45,13 +45,13 @@ ufmt_isdigit(UChar c,
|
||||
void
|
||||
ufmt_ltou(UChar *buffer,
|
||||
int32_t *len,
|
||||
long value,
|
||||
int32_t radix,
|
||||
uint32_t value,
|
||||
uint32_t radix,
|
||||
UBool uselower,
|
||||
int32_t minDigits)
|
||||
{
|
||||
int32_t length = 0;
|
||||
long q;
|
||||
uint32_t q;
|
||||
int8_t digit;
|
||||
UChar *left, *right, temp;
|
||||
|
||||
|
@ -25,8 +25,10 @@
|
||||
/**
|
||||
* Enum representing the possible argument types for uprintf/uscanf
|
||||
*/
|
||||
enum
|
||||
enum ufmt_type_info
|
||||
{
|
||||
ufmt_empty = 0,
|
||||
ufmt_simple_percent, /* %% do nothing */
|
||||
ufmt_count, /* special flag for count */
|
||||
ufmt_int, /* int */
|
||||
ufmt_char, /* int, cast to char */
|
||||
@ -46,12 +48,12 @@ enum
|
||||
* Union representing a uprintf/uscanf argument
|
||||
*/
|
||||
union ufmt_args {
|
||||
int intValue; /* int, UChar */
|
||||
float floatValue; /* float */
|
||||
double doubleValue; /* double */
|
||||
void *ptrValue; /* any pointer - void*, char*, wchar_t*, UChar* */
|
||||
wchar_t wcharValue; /* wchar_t */
|
||||
UDate dateValue; /* Date */
|
||||
signed int intValue; /* int, UChar */ /* TODO: Should int32_t be used instead of int? */
|
||||
float floatValue; /* float */
|
||||
double doubleValue; /* double */
|
||||
void *ptrValue; /* any pointer - void*, char*, wchar_t*, UChar* */
|
||||
wchar_t wcharValue; /* wchar_t */ /* TODO: Should wchar_t be used? */
|
||||
UDate dateValue; /* Date */
|
||||
};
|
||||
typedef union ufmt_args ufmt_args;
|
||||
|
||||
@ -95,8 +97,8 @@ ufmt_isdigit(UChar c,
|
||||
void
|
||||
ufmt_ltou(UChar *buffer,
|
||||
int32_t *len,
|
||||
long value,
|
||||
int32_t radix,
|
||||
uint32_t value,
|
||||
uint32_t radix,
|
||||
UBool uselower,
|
||||
int32_t minDigits);
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -47,21 +47,6 @@ struct u_printf_spec_info {
|
||||
};
|
||||
typedef struct u_printf_spec_info u_printf_spec_info;
|
||||
|
||||
/**
|
||||
* A u_printf info function.
|
||||
* A u_printf info is reponsible for reporting to u_printf how many
|
||||
* arguments are required for the <TT>u_printf_spec_info</TT> <TT>info</TT>,
|
||||
* and what their types are.
|
||||
* @param info A pointer to a <TT>u_print_info</TT> struct containing
|
||||
* information on the format specification.
|
||||
* @param argtypes The array to receive the types of arguments specified
|
||||
* by <TT>info</TT>.
|
||||
* @param n The number of available slots in the array <TT>argtypes</TT>
|
||||
* @return The number of arguments required by <TT>info</TT>.
|
||||
*/
|
||||
typedef int32_t (*u_printf_info) (const u_printf_spec_info *info,
|
||||
int32_t *argtypes,
|
||||
int32_t n);
|
||||
|
||||
/**
|
||||
* A u_printf handler function.
|
||||
@ -77,19 +62,6 @@ typedef int32_t (*u_printf_handler) (UFILE *stream,
|
||||
const u_printf_spec_info *info,
|
||||
const ufmt_args *args);
|
||||
|
||||
/**
|
||||
* Register a uprintf handler function with uprintf.
|
||||
* @param spec The format specififier handled by the handler <TT>func</TT>.
|
||||
* @param info A pointer to the <TT>uprintf_info</TT> function used
|
||||
* to determine how many arguments are required for <TT>spec</TT>, and
|
||||
* what their types are.
|
||||
* @param handler A pointer to the <TT>uprintf_handler</TT> function.
|
||||
* @return 0 if successful
|
||||
*/
|
||||
int32_t
|
||||
u_printf_register_handler(UChar spec,
|
||||
u_printf_info info,
|
||||
u_printf_handler handler);
|
||||
|
||||
#endif
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -39,22 +39,6 @@ struct u_scanf_spec_info {
|
||||
};
|
||||
typedef struct u_scanf_spec_info u_scanf_spec_info;
|
||||
|
||||
/**
|
||||
* A u_scanf info function.
|
||||
* A u_scanf info is reponsible for reporting to u_scanf how many
|
||||
* arguments are required for the <TT>u_scanf_spec_info</TT> <TT>info</TT>,
|
||||
* and what their types are.
|
||||
* @param info A pointer to a <TT>uscan_info</TT> struct containing
|
||||
* information on the format specification.
|
||||
* @param argtypes The array to receive the types of arguments specified
|
||||
* by <TT>info</TT>.
|
||||
* @param n The number of available slots in the array <TT>argtypes</TT>
|
||||
* @return The number of arguments required by <TT>info</TT>.
|
||||
*/
|
||||
typedef int32_t (*u_scanf_info) (const u_scanf_spec_info *info,
|
||||
int32_t *argtypes,
|
||||
int32_t n);
|
||||
|
||||
/**
|
||||
* A u_scanf handler function.
|
||||
* A u_scanf handler is responsible for handling a single u_scanf
|
||||
@ -76,19 +60,6 @@ typedef int32_t (*u_scanf_handler) (UFILE *stream,
|
||||
const UChar *fmt,
|
||||
int32_t *consumed);
|
||||
|
||||
/**
|
||||
* Register a u_scanf handler function with u_scanf.
|
||||
* @param spec The format specififier handled by the handler <TT>func</TT>.
|
||||
* @param nfo A pointer to the <TT>u_scanf_info</TT> function used
|
||||
* to determine how many arguments are required for <TT>spec</TT>, and
|
||||
* what their types are.
|
||||
* @param handler A pointer to the <TT>u_scanf_handler</TT> function.
|
||||
* @return 0 if successful
|
||||
*/
|
||||
int32_t
|
||||
u_scanf_register_handler (UChar spec,
|
||||
u_scanf_info info,
|
||||
u_scanf_handler handler);
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -56,7 +56,7 @@ u_scanf_scanset_init(u_scanf_scanset *scanset,
|
||||
UChar c;
|
||||
const UChar *limit;
|
||||
int32_t count;
|
||||
UBool result;
|
||||
UBool result = FALSE;
|
||||
|
||||
|
||||
/* set up parameters */
|
||||
|
Loading…
Reference in New Issue
Block a user