summaryrefslogtreecommitdiff
path: root/x2pmp.c
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-22 17:34:02 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-22 17:34:02 -0200
commitf53142c6882f08b646ebe6d614bb6f14d5dcdb57 (patch)
tree1cb3cb9a9ee9f94fcaf0533d394dd91207bf3da1 /x2pmp.c
parentbee786458655a081487f2caff112f85aa0c3c8de (diff)
Correct make distcheck and most gcc/sparse warnings.
Remaining warnings are due to bit/shift operations mixed with addition/multiplication/etc. "1<<2-1" should be read as "1 << (2 - 1)", and not "(1 << 2) - 1". The first 2 warnings appear to be for a confusing case, as a few lines bellow it is adding parenthesis to the shift operation, but should be being parsed correctly (not added parenthesis to avoid the adding them wrong, and "hiding" the warning...)
Diffstat (limited to 'x2pmp.c')
-rw-r--r--x2pmp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/x2pmp.c b/x2pmp.c
index ef1674c..0af1761 100644
--- a/x2pmp.c
+++ b/x2pmp.c
@@ -34,7 +34,7 @@ static void p_bitmap(
unsigned long buflen,
unsigned char *buf);
-static plane = 0;
+static int plane = 0;
#define FONT_HEIGHT 40
#define FONT_HEIGHT_PIXELS (FONT_HEIGHT*75/PPI)
#define FONT_WIDTH 24
@@ -65,7 +65,7 @@ void x2pmp(FILE *in, FILE *out,
if (header.file_version != XWD_FILE_VERSION) {
fprintf(stderr,"%s: file format version %d, not %d\n", progname,
- header.file_version, XWD_FILE_VERSION);
+ (int)header.file_version, XWD_FILE_VERSION);
}
win_name_size = abs_(header.header_size - sizeof(header));
@@ -95,6 +95,7 @@ void x2pmp(FILE *in, FILE *out,
if (head) real_height += FONT_HEIGHT_PIXELS << 1;
if (foot) real_height += FONT_HEIGHT_PIXELS << 1;
switch(orient) {
+ default:
case PORTRAIT:
case UPSIDE_DOWN:
scale = min_((p_width - 2*x_pos) / fixed_width,
@@ -165,7 +166,7 @@ void x2pmp(FILE *in, FILE *out,
}
/* we don't want the last bits up to the byte/word alignment set */
- if (no_of_bits = fixed_width - width) {
+ if ((no_of_bits = fixed_width - width)) {
int i, j, mask = ~bits_set(no_of_bits % 8);
for(i = 0; i < height; i++) {
unsigned char *s = buffer + (i+1) * byte_width ;