summaryrefslogtreecommitdiff
path: root/x11perf.c
diff options
context:
space:
mode:
Diffstat (limited to 'x11perf.c')
-rw-r--r--x11perf.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/x11perf.c b/x11perf.c
index 71c7e1c..c5129d7 100644
--- a/x11perf.c
+++ b/x11perf.c
@@ -1,5 +1,3 @@
-/* $Xorg: x11perf.c,v 1.4 2000/08/17 19:54:10 cpqbld Exp $ */
-/* $XdotOrg: app/x11perf/x11perf.c,v 1.3 2005/07/26 18:55:42 alanc Exp $ */
/****************************************************************************
Copyright 1988, 1989 by Digital Equipment Corporation, Maynard, Massachusetts.
@@ -22,7 +20,6 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE.
****************************************************************************/
-/* $XFree86: xc/programs/x11perf/x11perf.c,v 3.6 2001/11/03 21:59:20 dawes Exp $ */
#include <stdio.h>
#include <ctype.h>
@@ -43,13 +40,14 @@ SOFTWARE.
/* Only for working on ``fake'' servers, for hardware that doesn't exist */
static Bool drawToFakeServer = False;
+static Bool falsePrecision = False;
static Pixmap tileToQuery = None;
static char *displayName;
int abortTest;
typedef struct _RopNames { char *name; int rop; } RopNameRec, *RopNamePtr;
-RopNameRec ropNames[] = {
+static RopNameRec ropNames[] = {
{ "clear", GXclear }, /* 0 */
{ "and", GXand }, /* src AND dst */
{ "andReverse", GXandReverse }, /* src AND NOT dst */
@@ -68,7 +66,7 @@ RopNameRec ropNames[] = {
{ "set", GXset } /* 1 */
};
-RopNameRec popNames[] = {
+static RopNameRec popNames[] = {
{ "Clear", PictOpClear },
{ "Src", PictOpSrc },
{ "Dst", PictOpDst },
@@ -85,7 +83,7 @@ RopNameRec popNames[] = {
{ "Saturate", PictOpSaturate },
};
-RopNameRec formatNames[] = {
+static RopNameRec formatNames[] = {
{ "RGB24", PictStandardRGB24 },
{ "ARGB32", PictStandardARGB32 },
{ "A8", PictStandardA8 },
@@ -94,7 +92,7 @@ RopNameRec formatNames[] = {
{ "NATIVE", PictStandardNative },
};
-char *(visualClassNames)[] = {
+static char *(visualClassNames)[] = {
"StaticGray",
"GrayScale",
"StaticColor",
@@ -252,9 +250,11 @@ RoundTo3Digits(double d)
{
/* It's kind of silly to print out things like ``193658.4/sec'' so just
junk all but 3 most significant digits. */
-
double exponent, sign;
+ if (falsePrecision)
+ return d;
+
exponent = 1.0;
/* the code below won't work if d should happen to be non-positive. */
if (d < 0.0) {
@@ -978,10 +978,12 @@ main(int argc, char *argv[])
foundOne = True;
} else if (strcmp (argv[i], "-sync") == 0) {
synchronous = True;
- } else if (strcmp(argv[i], "-pack") == 0) {
+ } else if (strcmp (argv[i], "-pack") == 0) {
xparms.pack = True;
} else if (strcmp (argv[i], "-draw") == 0) {
drawToFakeServer = True;
+ } else if (strcmp (argv[i], "-falseprecision") == 0) {
+ falsePrecision = True;
} else if (strcmp (argv[i], "-repeat") == 0) {
i++;
if (argc <= i)
@@ -1094,14 +1096,14 @@ main(int argc, char *argv[])
len = strlen(argv[i]);
if(len>=3)
ForEachTest (j) {
- if (Strstr (test[j].option, argv[i]+1) != 0) {
+ if (Strstr (test[j].option, argv[i]+1) != NULL) {
fprintf(stderr," -> %s %s\n", test[j].option, LABELP(j));
doit[j] = found = True;
}
}
if(!found)
ForEachTest (j) {
- if (Strstr (LABELP(j), argv[i]+1) != 0) {
+ if (Strstr (LABELP(j), argv[i]+1) != NULL) {
fprintf(stderr," -> %s %s\n", test[j].option, LABELP(j));
doit[j] = found = True;
}