[PATCH 2/4] Define what_lens as int, not as size_t

Pavel Roskin proski at gnu.org
Sun Feb 7 01:54:24 UTC 2010


This fixes compiler warnings:

dial.c: In function 'horiz_draw':
dial.c:1269: warning: field precision should have type 'int', but argument
3 has type 'size_t'
file.c: In function 'horiz_draw':
file.c:98: warning: field precision should have type 'int', but argument 3
has type 'size_t'

int should be long enough to hold precision.
---
 src/dial.c |    2 +-
 src/file.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/dial.c b/src/dial.c
index 069533f..90a76b9 100644
--- a/src/dial.c
+++ b/src/dial.c
@@ -1254,7 +1254,7 @@ static const char *const what[] =
 /* Offsets of what[] entries from position_dialing_directory */
 #define DIALOPTS (sizeof(what) / sizeof(*what))
 #define DIAL_WIDTH 8 /* Width of one entry */
-static size_t what_lens[DIALOPTS]; /* Number of bytes for <= 7 characters */
+static int what_lens[DIALOPTS]; /* Number of bytes for <= 7 characters */
 /* Number of ' ' padding entries at left and right, left is >= 1 */
 static int what_padding[DIALOPTS][2];
 
diff --git a/src/file.c b/src/file.c
index 381b3eb..fda38e7 100644
--- a/src/file.c
+++ b/src/file.c
@@ -67,7 +67,7 @@ static const char *const what[] =
 #define WHAT_NR_OPTIONS (sizeof (what) / sizeof (*what))
 #define WHAT_WIDTH 8 /* Width of one entry */
 /* Number of bytes for <= 7 characters */
-static size_t what_lens[WHAT_NR_OPTIONS];
+static int what_lens[WHAT_NR_OPTIONS];
 /* Number of ' ' padding entries at left and right, left is >= 1 */
 static int what_padding[WHAT_NR_OPTIONS][2];
 static int dprev;



More information about the minicom-devel mailing list