[cairo-commit] src/cairo-pdf-operators.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Nov 22 10:50:55 PST 2010


 src/cairo-pdf-operators.c |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit abff335348c4f3b1c694cf44bf089d2a437937b4
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Nov 22 18:49:22 2010 +0000

    pdf: Silence compiler for an impossible case
    
    Make the default case be an assert to catch a silly programming error
    and silence the compiler:
    
      cairo-pdf-operators.c: In function ‘_word_wrap_stream_write’:
      cairo-pdf-operators.c:300: warning: ‘count’ may be used uninitialized in
      this function
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/cairo-pdf-operators.c b/src/cairo-pdf-operators.c
index bbaa3eb..54a30b2 100644
--- a/src/cairo-pdf-operators.c
+++ b/src/cairo-pdf-operators.c
@@ -325,7 +325,11 @@ _word_wrap_stream_write (cairo_output_stream_t  *base,
 	    }
 	    if (*data != '\n')
 		_cairo_output_stream_write (stream->output, data, 1);
+	    break;
 
+	default:
+	    ASSERT_NOT_REACHED;
+	    count = length;
 	    break;
 	}
 	data += count;


More information about the cairo-commit mailing list