From 1d4362b67bcb5bc6411dad6b16e9bdf068253f49 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Sun, 16 Mar 2008 17:25:41 -0300 Subject: [PATCH] Compile warning fixes. Follow pattern already used and declare functions as static to avoid warnings about missing prototypes. Cast some printf arguments. Only possible problem could be changing *(INT32 *) to *(int *), but it is only printf arguments, and I don't think Xorg supports any architecture where int isn't a 32 bits integer. --- xrandr.c | 40 +++++++++++++++++++++------------------- 1 files changed, 21 insertions(+), 19 deletions(-) diff --git a/xrandr.c b/xrandr.c index 41e15dd..35e65c0 100644 --- a/xrandr.c +++ b/xrandr.c @@ -431,7 +431,7 @@ set_name (name_t *name, char *string, name_kind_t valid) XID xid; int index; - if ((valid & name_xid) && sscanf (string, "0x%x", &xid) == 1) + if ((valid & name_xid) && sscanf (string, "0x%x", (unsigned int *)&xid) == 1) set_name_xid (name, xid); else if ((valid & name_index) && sscanf (string, "%d", &index) == 1) set_name_index (name, index); @@ -571,6 +571,7 @@ find_mode_by_xid (RRMode mode) return find_mode (&mode_name, 0); } +#if 0 static XRRModeInfo * find_mode_by_name (char *name) { @@ -579,6 +580,7 @@ find_mode_by_name (char *name) set_name_string (&mode_name, name); return find_mode (&mode_name, 0); } +#endif static XRRModeInfo * @@ -618,7 +620,7 @@ find_mode_for_output (output_t *output, name_t *name) return best; } -XRRModeInfo * +static XRRModeInfo * preferred_mode (output_t *output) { XRROutputInfo *output_info = output->output_info; @@ -1051,7 +1053,7 @@ panic (Status s, crtc_t *crtc) exit (1); } -void +static void apply (void) { Status s; @@ -1133,7 +1135,7 @@ apply (void) /* * Use current output state to complete the output list */ -void +static void get_outputs (void) { int o; @@ -1207,7 +1209,7 @@ get_outputs (void) } } -void +static void mark_changing_crtcs (void) { int c; @@ -1240,7 +1242,7 @@ mark_changing_crtcs (void) /* * Test whether 'crtc' can be used for 'output' */ -Bool +static Bool check_crtc_for_output (crtc_t *crtc, output_t *output, Bool ignore_state) { int c; @@ -1304,7 +1306,7 @@ check_crtc_for_output (crtc_t *crtc, output_t *output, Bool ignore_state) return True; } -crtc_t * +static crtc_t * find_crtc_for_output (output_t *output) { int c; @@ -1470,8 +1472,8 @@ set_screen_size (void) } #endif - -void + +static void disable_outputs (output_t *outputs) { while (outputs) @@ -1484,7 +1486,7 @@ disable_outputs (output_t *outputs) /* * find the best mapping from output to crtc available */ -int +static int pick_crtcs_score (output_t *outputs) { output_t *output; @@ -1550,7 +1552,7 @@ pick_crtcs_score (output_t *outputs) /* * Pick crtcs for any changing outputs that don't have one */ -void +static void pick_crtcs (void) { output_t *output; @@ -2274,7 +2276,7 @@ main (int argc, char **argv) mode_height (mode, output->rotation), output->x, output->y); if (verbose) - printf (" (0x%x)", mode->id); + printf (" (0x%x)", (unsigned int)mode->id); if (output->rotation != RR_Rotate_0 || verbose) { printf (" %s", @@ -2310,14 +2312,14 @@ main (int argc, char **argv) if (mode) { printf (" %dmm x %dmm", - output_info->mm_width, output_info->mm_height); + (unsigned int)output_info->mm_width, (unsigned int )output_info->mm_height); } printf ("\n"); if (verbose) { - printf ("\tIdentifier: 0x%x\n", output->output.xid); - printf ("\tTimestamp: %d\n", output_info->timestamp); + printf ("\tIdentifier: 0x%x\n", (unsigned int)output->output.xid); + printf ("\tTimestamp: %ld\n", (unsigned long)output_info->timestamp); printf ("\tSubpixel: %s\n", order[output_info->subpixel_order]); printf ("\tClones: "); for (j = 0; j < output_info->nclone; j++) @@ -2374,14 +2376,14 @@ main (int argc, char **argv) { printf("\t%s: %d (0x%08x)", XGetAtomName (dpy, props[j]), - *(INT32 *)prop, *(INT32 *)prop); + *(int *)prop, *(int *)prop); if (propinfo->range && propinfo->num_values > 0) { printf(" range%s: ", (propinfo->num_values == 2) ? "" : "s"); for (k = 0; k < propinfo->num_values / 2; k++) - printf(" (%d,%d)", propinfo->values[k * 2], + printf(" (%ld,%ld)", propinfo->values[k * 2], propinfo->values[k * 2 + 1]); } @@ -2425,7 +2427,7 @@ main (int argc, char **argv) int f; printf (" %s (0x%x) %6.1fMHz", - mode->name, mode->id, + mode->name, (unsigned int)mode->id, (float)mode->dotClock / 1000000.0); for (f = 0; mode_flags[f].flag; f++) if (mode->modeFlags & mode_flags[f].flag) @@ -2486,7 +2488,7 @@ main (int argc, char **argv) if (!(mode->modeFlags & ModeShown)) { printf (" %s (0x%x) %6.1fMHz\n", - mode->name, mode->id, + mode->name, (unsigned int)mode->id, (float)mode->dotClock / 1000000.0); printf (" h: width %4d start %4d end %4d total %4d skew %4d clock %6.1fKHz\n", mode->width, mode->hSyncStart, mode->hSyncEnd, -- 1.5.3.2