GNOME Bugzilla – Bug 786261
gif: change ptr, size, and amount_needed from guint to size_t
Last modified: 2017-08-24 07:18:16 UTC
This fixes some compiler warnings reg. dealing with pointers.
Created attachment 357533 [details] [review] gif: change ptr, size, and amount_needed from guint to size_t With -Wconversion gcc complains with the following warning: io-gif.c: In function ‘gif_read’: io-gif.c:246:20: warning: conversion to ‘guint {aka unsigned int}’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion] context->ptr += len; ^ io-gif.c:258:28: warning: conversion to ‘guint {aka unsigned int}’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion] context->amount_needed = len - (context->size - context->ptr); This change simply changes their types to match the rhs.
Review of attachment 357533 [details] [review]: > gif: change ptr, size, and amount_needed from guint to size_t Please state the effect of the patch, not what code you changed. ::: gdk-pixbuf/io-gif.c @@ +146,3 @@ gpointer user_data; guchar *buf; + size_t ptr; a gsize would look nicer to me :)
Created attachment 357829 [details] [review] gif: Fix compiler warning reg. type conversion With -Wconversion gcc complains with the following warning: io-gif.c: In function ‘gif_read’: io-gif.c:246:20: warning: conversion to ‘guint {aka unsigned int}’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion] context->ptr += len; ^ io-gif.c:258:28: warning: conversion to ‘guint {aka unsigned int}’ from ‘size_t {aka long unsigned int}’ may alter its value [-Wconversion] context->amount_needed = len - (context->size - context->ptr); This change simply changes their types to match the rhs.
Review of attachment 357829 [details] [review]: Sure.
Comment on attachment 357829 [details] [review] gif: Fix compiler warning reg. type conversion Committed as 853c60427f7ebb6b9cdfd142923167af70f13536