fprintf_line(stdout, line_string, line_length);
}
+
/* int2str() returns a number converted to a string;
the used memory is static, but will be overwritten by later calls,
so if you want to save the result, copy it to a private string buffer;
}
}
+
/* something similar to "int2str()" above, but allocates its own memory
and has a different interface; we cannot use "itoa()", because this
seems to be already defined when cross-compiling to the win32 target */
}
+/* calculate base-2 logarithm of argument (rounded down to integer;
+ this function returns the number of the highest bit set in argument) */
+
+int log_2(unsigned int x)
+{
+ int e = 0;
+
+ while ((1 << e) < x)
+ {
+ x -= (1 << e); /* for rounding down (rounding up: remove this line) */
+ e++;
+ }
+
+ return e;
+}
+
+
/* ------------------------------------------------------------------------- */
/* counter functions */
/* ------------------------------------------------------------------------- */
options.execute_command = option_arg;
if (option_arg == next_option)
options_left++;
+
+#if 1
+ /* when doing batch processing, always enable verbose mode (warnings) */
+ options.verbose = TRUE;
+#endif
}
else if (*option == '-')
{
*y2 = help_y;
}
-short getFile16BitInteger(FILE *file, int byte_order)
+int getFile16BitInteger(FILE *file, int byte_order)
{
if (byte_order == BYTE_ORDER_BIG_ENDIAN)
- return ((fgetc(file) << 8) |
- (fgetc(file) << 0));
+ return ((fgetc(file) << 8) |
+ (fgetc(file) << 0));
else /* BYTE_ORDER_LITTLE_ENDIAN */
- return ((fgetc(file) << 0) |
- (fgetc(file) << 8));
+ return ((fgetc(file) << 0) |
+ (fgetc(file) << 8));
}
-void putFile16BitInteger(FILE *file, short value, int byte_order)
+void putFile16BitInteger(FILE *file, int value, int byte_order)
{
if (byte_order == BYTE_ORDER_BIG_ENDIAN)
{
- fputc((value >> 8) & 0xff, file);
- fputc((value >> 0) & 0xff, file);
+ fputc((value >> 8) & 0xff, file);
+ fputc((value >> 0) & 0xff, file);
}
else /* BYTE_ORDER_LITTLE_ENDIAN */
{
- fputc((value >> 0) & 0xff, file);
- fputc((value >> 8) & 0xff, file);
+ fputc((value >> 0) & 0xff, file);
+ fputc((value >> 8) & 0xff, file);
}
}
char c = name_ptr[6];
if (c >= '0' && c <= '9')
- key = KSYM_0 + (Key)(c - '0');
+ key = KSYM_KP_0 + (Key)(c - '0');
}
else if (strncmp(name_ptr, "XK_F", 4) == 0 && strlen(name_ptr) <= 6)
{
new_list_entry = &(*list)[*num_list_entries - 1];
new_list_entry->token = getStringCopy(token);
+ new_list_entry->default_filename = NULL;
new_list_entry->filename = NULL;
new_list_entry->parameter = checked_calloc(parameter_array_size);
#endif
for (i = 0; i < num_dynamic_file_list_entries; i++)
+ {
LoadArtworkToList(artwork_info, &artwork_info->dynamic_artwork_list[i],
dynamic_file_list[i].filename, i);
+#if 0
+ printf("::: '%s', '0x%08x'\n",
+ dynamic_file_list[i].filename,
+ dynamic_file_list[i].default_filename);
+#endif
+ }
+
#if 0
dumpList(artwork_info->content_list);
#endif