Fix a gcc43 warning and mark the binbuffer
authorFabian Keil <fk@fabiankeil.de>
Wed, 3 Jan 2007 14:39:19 +0000 (14:39 +0000)
committerFabian Keil <fk@fabiankeil.de>
Wed, 3 Jan 2007 14:39:19 +0000 (14:39 +0000)
as immutable for buf_getbyte().

deanimate.c

index b9592e8..278c366 100644 (file)
@@ -1,7 +1,7 @@
-const char deanimate_rcs[] = "$Id: deanimate.c,v 1.12.2.1 2004/10/03 12:53:32 david__schmidt Exp $";
+const char deanimate_rcs[] = "$Id: deanimate.c,v 1.14 2006/07/18 14:48:45 david__schmidt Exp $";
 /*********************************************************************
  *
 /*********************************************************************
  *
- * File        :  $Source: /cvsroot/ijbswa/current/Attic/deanimate.c,v $
+ * File        :  $Source: /cvsroot/ijbswa/current/deanimate.c,v $
  *
  * Purpose     :  Declares functions to manipulate binary images on the
  *                fly.  High-level functions include:
  *
  * Purpose     :  Declares functions to manipulate binary images on the
  *                fly.  High-level functions include:
@@ -12,7 +12,7 @@ const char deanimate_rcs[] = "$Id: deanimate.c,v 1.12.2.1 2004/10/03 12:53:32 da
  *                buf_copy,  buf_getbyte, gif_skip_data_block,
  *                gif_extract_image and jpeg_inspect
  *
  *                buf_copy,  buf_getbyte, gif_skip_data_block,
  *                gif_extract_image and jpeg_inspect
  *
- * Copyright   :  Written by and Copyright (C) 2001 - 2004 by the the
+ * Copyright   :  Written by and Copyright (C) 2001 - 2004, 2006 by the
  *                SourceForge Privoxy team. http://www.privoxy.org/
  *
  *                Based on the GIF file format specification (see
  *                SourceForge Privoxy team. http://www.privoxy.org/
  *
  *                Based on the GIF file format specification (see
@@ -40,6 +40,10 @@ const char deanimate_rcs[] = "$Id: deanimate.c,v 1.12.2.1 2004/10/03 12:53:32 da
  *
  * Revisions   :
  *    $Log: deanimate.c,v $
  *
  * Revisions   :
  *    $Log: deanimate.c,v $
+ *    Revision 1.14  2006/07/18 14:48:45  david__schmidt
+ *    Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
+ *    with what was really the latest development (the v_3_0_branch branch)
+ *
  *    Revision 1.12.2.1  2004/10/03 12:53:32  david__schmidt
  *    Add the ability to check jpeg images for invalid
  *    lengths of comment blocks.  Defensive strategy
  *    Revision 1.12.2.1  2004/10/03 12:53:32  david__schmidt
  *    Add the ability to check jpeg images for invalid
  *    lengths of comment blocks.  Defensive strategy
@@ -232,7 +236,7 @@ int buf_copy(struct binbuffer *src, struct binbuffer *dst, size_t length)
  * Returns     :  The byte on success, or 0 on failiure
  *
  *********************************************************************/
  * Returns     :  The byte on success, or 0 on failiure
  *
  *********************************************************************/
-unsigned char buf_getbyte(struct binbuffer *src, size_t offset)
+unsigned char buf_getbyte(const struct binbuffer *src, size_t offset)
 {
    if (src->offset + offset < src->size)
    {
 {
    if (src->offset + offset < src->size)
    {
@@ -272,7 +276,8 @@ int gif_skip_data_block(struct binbuffer *buf)
     */
    while((c = buf_getbyte(buf, 0)) != '\0')
    {
     */
    while((c = buf_getbyte(buf, 0)) != '\0')
    {
-      if ((buf->offset += c + 1) >= buf->size - 1)
+      buf->offset += (size_t)c + 1;
+      if (buf->offset >= buf->size - 1)
       {
          return 1;
       }
       {
          return 1;
       }