From: Gerhard Sittig Date: Sat, 12 May 2018 12:20:44 +0000 (+0200) Subject: input/chronovu_la8: address file size data type nits X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f54a55da2dc6b60b0ba153bc61e44415f5ed2004;p=libsigrok.git input/chronovu_la8: address file size data type nits Although the file format handled by this input module appears to be of fixed size (8MiB plus 5 more bytes), it's more reliable to use a data type for the file size that is larger than "an int". Although off_t would be most portable, use uint64_t to match the code which passes the parameter to the input module. --- diff --git a/src/input/chronovu_la8.c b/src/input/chronovu_la8.c index 6607f3a7..e83d5822 100644 --- a/src/input/chronovu_la8.c +++ b/src/input/chronovu_la8.c @@ -39,7 +39,7 @@ struct context { static int format_match(GHashTable *metadata, unsigned int *confidence) { - int size; + uint64_t size; /* * In the absence of a reliable condition like magic strings, @@ -47,7 +47,7 @@ static int format_match(GHashTable *metadata, unsigned int *confidence) * rather weak a condition, signal "little confidence" and * optionally give precedence to better matches. */ - size = GPOINTER_TO_INT(g_hash_table_lookup(metadata, + size = GPOINTER_TO_SIZE(g_hash_table_lookup(metadata, GINT_TO_POINTER(SR_INPUT_META_FILESIZE))); if (size != CHRONOVU_LA8_FILESIZE) return SR_ERR;