summaryrefslogtreecommitdiff
path: root/xvinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'xvinfo.c')
-rw-r--r--xvinfo.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/xvinfo.c b/xvinfo.c
index 49c60cd..ade4cc2 100644
--- a/xvinfo.c
+++ b/xvinfo.c
@@ -25,7 +25,6 @@ main(int argc, char *argv[])
{
Display *dpy;
unsigned int ver, rev, eventB, reqB, errorB;
- int i, j, k, n;
unsigned int nencode, nadaptors;
int nscreens, nattr, numImages;
XvAdaptorInfo *ainfo;
@@ -42,7 +41,7 @@ main(int argc, char *argv[])
PrintUsage();
if (argc != 1) {
- for (i = 1; i < argc; i++) {
+ for (int i = 1; i < argc; i++) {
if (!strcmp(argv[i], "-display")) {
if (++i >= argc) {
fprintf (stderr, "%s: missing argument to -display\n",
@@ -82,7 +81,7 @@ main(int argc, char *argv[])
nscreens = ScreenCount(dpy);
- for (i = 0; i < nscreens; i++) {
+ for (int i = 0; i < nscreens; i++) {
fprintf(stdout, "screen #%i\n", i);
if (Success != XvQueryAdaptors(dpy, RootWindow(dpy, i), &nadaptors,
&ainfo)) {
@@ -96,7 +95,7 @@ main(int argc, char *argv[])
continue;
}
- for (j = 0; j < nadaptors; j++) {
+ for (unsigned int j = 0; j < nadaptors; j++) {
fprintf(stdout, " Adaptor #%i: \"%s\"\n", j, ainfo[j].name);
fprintf(stdout, " number of ports: %li\n", ainfo[j].num_ports);
fprintf(stdout, " port base: %li\n", ainfo[j].base_id);
@@ -126,7 +125,7 @@ main(int argc, char *argv[])
if (!shortmode) {
fprintf(stdout, " supported visuals:\n");
- for (k = 0; k < ainfo[j].num_formats; k++, format++) {
+ for (unsigned long k = 0; k < ainfo[j].num_formats; k++, format++) {
fprintf(stdout, " depth %i, visualID 0x%2lx\n",
format->depth, format->visual_id);
}
@@ -137,7 +136,7 @@ main(int argc, char *argv[])
if (attributes && nattr) {
fprintf(stdout, " number of attributes: %i\n", nattr);
- for (k = 0; k < nattr; k++) {
+ for (int k = 0; k < nattr; k++) {
fprintf(stdout, " \"%s\" (range %i to %i)\n",
attributes[k].name,
attributes[k].min_value, attributes[k].max_value);
@@ -195,7 +194,7 @@ main(int argc, char *argv[])
if (encodings && nencode) {
unsigned int ImageEncodings = 0;
- for (n = 0; n < nencode; n++) {
+ for (unsigned int n = 0; n < nencode; n++) {
if (!strcmp(encodings[n].name, "XV_IMAGE"))
ImageEncodings++;
}
@@ -204,7 +203,7 @@ main(int argc, char *argv[])
fprintf(stdout, " number of encodings: %i\n",
nencode - ImageEncodings);
- for (n = 0; n < nencode; n++) {
+ for (unsigned int n = 0; n < nencode; n++) {
if (strcmp(encodings[n].name, "XV_IMAGE")) {
fprintf(stdout, " encoding ID #%li: \"%s\"\n",
encodings[n].encoding_id,
@@ -219,7 +218,7 @@ main(int argc, char *argv[])
}
if (ImageEncodings && (ainfo[j].type & XvImageMask)) {
- for (n = 0; n < nencode; n++) {
+ for (unsigned int n = 0; n < nencode; n++) {
if (!strcmp(encodings[n].name, "XV_IMAGE")) {
fprintf(stdout,
" maximum XvImage size: %li x %li\n",
@@ -234,7 +233,7 @@ main(int argc, char *argv[])
fprintf(stdout, " Number of image formats: %i\n",
numImages);
- for (n = 0; n < numImages; n++) {
+ for (int n = 0; n < numImages; n++) {
char imageName[5];
snprintf(imageName, sizeof(imageName), "%c%c%c%c",