From c4a63b128d3f8405fa1037e0c22bd8fabcbdd123 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 7 Mar 2011 23:12:45 -0800 Subject: [PATCH] * coding.c: (decode_coding_object, encode_coding_object, detect_coding_system): Mark variables that gcc -Wuninitialized does not deduce are never used uninitialized. --- src/ChangeLog | 3 +++ src/coding.c | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 1b518a6341c..ae111aef44c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -53,6 +53,9 @@ * coding.c (emacs_mule_char, encode_invocation_designation): Now static, since they're not used elsewhere. (decode_coding_iso_2022): Add "default: abort ();" as a safety check. + (decode_coding_object, encode_coding_object, detect_coding_system): + Mark variables that gcc -Wuninitialized does not deduce are never + used uninitialized. 2011-03-06 Chong Yidong diff --git a/src/coding.c b/src/coding.c index c9d32489351..75fc92eee8d 100644 --- a/src/coding.c +++ b/src/coding.c @@ -7658,12 +7658,12 @@ decode_coding_object (struct coding_system *coding, Lisp_Object dst_object) { int count = SPECPDL_INDEX (); - unsigned char *destination; - EMACS_INT dst_bytes; + unsigned char *destination IF_LINT (= NULL); + EMACS_INT dst_bytes IF_LINT (= 0); EMACS_INT chars = to - from; EMACS_INT bytes = to_byte - from_byte; Lisp_Object attrs; - int saved_pt = -1, saved_pt_byte; + int saved_pt = -1, saved_pt_byte IF_LINT (= 0); int need_marker_adjustment = 0; Lisp_Object old_deactivate_mark; @@ -7851,7 +7851,7 @@ encode_coding_object (struct coding_system *coding, EMACS_INT chars = to - from; EMACS_INT bytes = to_byte - from_byte; Lisp_Object attrs; - int saved_pt = -1, saved_pt_byte; + int saved_pt = -1, saved_pt_byte IF_LINT (= 0); int need_marker_adjustment = 0; int kill_src_buffer = 0; Lisp_Object old_deactivate_mark; @@ -8184,8 +8184,8 @@ detect_coding_system (const unsigned char *src, base_category = XINT (CODING_ATTR_CATEGORY (attrs)); if (base_category == coding_category_undecided) { - enum coding_category category; - struct coding_system *this; + enum coding_category category IF_LINT (= 0); + struct coding_system *this IF_LINT (= NULL); int c, i; /* Skip all ASCII bytes except for a few ISO2022 controls. */ -- 2.39.5