*****************************************************************************/
/*
- * Copyright (C) 2000 - 2004, R. Byron Moore
+ * Copyright (C) 2000 - 2005, R. Byron Moore
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
{
u32 num_digits;
acpi_integer current_value;
- acpi_integer quotient;
ACPI_FUNCTION_TRACE ("ex_digits_needed");
- /*
- * acpi_integer is unsigned, so we don't worry about a '-'
- */
- if ((current_value = value) == 0) {
+ /* acpi_integer is unsigned, so we don't worry about a '-' prefix */
+
+ if (value == 0) {
return_VALUE (1);
}
+ current_value = value;
num_digits = 0;
+ /* Count the digits in the requested base */
+
while (current_value) {
- (void) acpi_ut_short_divide (¤t_value, base, "ient, NULL);
+ (void) acpi_ut_short_divide (current_value, base, ¤t_value, NULL);
num_digits++;
- current_value = quotient;
}
return_VALUE (num_digits);
u32 count;
u32 digits_needed;
u32 remainder;
- acpi_integer quotient;
ACPI_FUNCTION_ENTRY ();
out_string[digits_needed] = 0;
for (count = digits_needed; count > 0; count--) {
- (void) acpi_ut_short_divide (&value, 10, "ient, &remainder);
+ (void) acpi_ut_short_divide (value, 10, &value, &remainder);
out_string[count-1] = (char) ('0' + remainder);\
- value = quotient;
}
}