Skip to content

Commit

Permalink
fixed: xbmc#7387 Supress warnings in xbmc-xrandr with gcc 4.4
Browse files Browse the repository at this point in the history
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@24215 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
  • Loading branch information
althekiller committed Nov 3, 2009
1 parent 3e751a2 commit 638c053
Showing 1 changed file with 13 additions and 50 deletions.
63 changes: 13 additions & 50 deletions xbmc-xrandr.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <string.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdint.h>
#include <math.h>

#if RANDR_MAJOR > 1 || (RANDR_MAJOR == 1 && RANDR_MINOR >= 2)
Expand Down Expand Up @@ -581,16 +582,6 @@ find_mode_by_xid (RRMode mode)
}

static XRRModeInfo *
find_mode_by_name (char *name)
{
name_t mode_name;
init_name (&mode_name);
set_name_string (&mode_name, name);
return find_mode (&mode_name, 0);
}

static
XRRModeInfo *
find_mode_for_output (output_t *output, name_t *name)
{
XRROutputInfo *output_info = output->output_info;
Expand Down Expand Up @@ -695,32 +686,6 @@ crtc_can_use_rotation (crtc_t *crtc, Rotation rotation)
return False;
}

/*
* Report only rotations that are supported by all crtcs
*/
static Rotation
output_rotations (output_t *output)
{
Bool found = False;
Rotation rotation = RR_Rotate_0;
XRROutputInfo *output_info = output->output_info;
int c;

for (c = 0; c < output_info->ncrtc; c++)
{
crtc_t *crtc = find_crtc_by_xid (output_info->crtcs[c]);
if (crtc)
{
if (!found) {
rotation = crtc->crtc_info->rotations;
found = True;
} else
rotation &= crtc->crtc_info->rotations;
}
}
return rotation;
}

static Bool
output_can_use_rotation (output_t *output, Rotation rotation)
{
Expand Down Expand Up @@ -1593,7 +1558,7 @@ main (int argc, char **argv)
int rot = -1;
int query = 0;
Rotation rotation, current_rotation, rotations;
XEvent event;
XRRScreenChangeNotifyEvent event;
XRRScreenChangeNotifyEvent *sce;
char *display_name = NULL;
int i, j;
Expand Down Expand Up @@ -2083,8 +2048,8 @@ main (int argc, char **argv)
Atom name = XInternAtom (dpy, prop->name, False);
Atom type;
int format;
unsigned char *data;
int nelements;
unsigned char *data = NULL;
int nelements = 0;
int int_value;
unsigned long ulong_value;
unsigned char *prop_data;
Expand Down Expand Up @@ -2227,7 +2192,6 @@ main (int argc, char **argv)
if (query_1_2 || (query && has_1_2 && !query_1))
{
output_t *output;
int m;

#define ModeShown 0x80000000

Expand All @@ -2247,7 +2211,6 @@ main (int argc, char **argv)
Atom *props;
int j, k, nprop;
Bool *mode_shown;
Rotation rotations = output_rotations (output);

printf (" <output name=\"%s\" connected=\"%s\"", output_info->name, connection[output_info->connection]);
if (mode)
Expand All @@ -2257,7 +2220,7 @@ main (int argc, char **argv)
mode_height (mode, output->rotation),
output->x, output->y);
if (verbose)
printf (" id=\"%x\"", mode->id);
printf (" id=\"%lx\"", mode->id);
if (output->rotation != RR_Rotate_0 || verbose)
{
printf (" rotation=\"%s\"",
Expand Down Expand Up @@ -2293,15 +2256,15 @@ main (int argc, char **argv)
*/
if (mode)
{
printf (" wmm=\"%d\" hmm=\"%d\"",
printf (" wmm=\"%lu\" hmm=\"%lu\"",
output_info->mm_width, 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%lx\n", output->output.xid);
printf ("\tTimestamp: %lu\n", output_info->timestamp);
printf ("\tSubpixel: %s\n", order[output_info->subpixel_order]);
printf ("\tClones: ");
for (j = 0; j < output_info->nclone; j++)
Expand Down Expand Up @@ -2358,14 +2321,14 @@ main (int argc, char **argv)
{
printf("\t%s: %d (0x%08x)",
XGetAtomName (dpy, props[j]),
*(INT32 *)prop, *(INT32 *)prop);
*(int32_t*)prop, *(uint32_t*)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]);
}

Expand Down Expand Up @@ -2409,7 +2372,7 @@ main (int argc, char **argv)
XRRModeInfo *mode = find_mode_by_xid (output_info->modes[j]);
int f;

printf (" %s (0x%x) %6.1fMHz",
printf (" %s (0x%lx) %6.1fMHz",
mode->name, mode->id,
(float)mode->dotClock / 1000000.0);
for (f = 0; mode_flags[f].flag; f++)
Expand Down Expand Up @@ -2443,7 +2406,7 @@ main (int argc, char **argv)
if (strcmp (jmode->name, kmode->name) != 0) continue;
mode_shown[k] = True;
kmode->modeFlags |= ModeShown;
printf (" <mode id=\"0x%x\" name=\"%s\" w=\"%d\" h=\"%d\" hz=\"%.5f\"", kmode->id, kmode->name, kmode->width, kmode->height, mode_refresh (kmode));
printf (" <mode id=\"0x%lx\" name=\"%s\" w=\"%d\" h=\"%d\" hz=\"%.5f\"", kmode->id, kmode->name, kmode->width, kmode->height, mode_refresh (kmode));
if (kmode == output->mode_info)
printf (" current=\"true\"");
else
Expand Down Expand Up @@ -2640,7 +2603,7 @@ main (int argc, char **argv)

printf ("Event received, type = %d\n", event.type);
/* update Xlib's knowledge of the event */
XRRUpdateConfiguration (&event);
XRRUpdateConfiguration ((XEvent*)&event);
if (event.type == ConfigureNotify)
printf("Received ConfigureNotify Event!\n");

Expand Down

0 comments on commit 638c053

Please sign in to comment.