round as a #define - and xpm loader has extra rgb.txt sourc

SVN revision: 31485
This commit is contained in:
Carsten Haitzler 2007-08-25 02:07:08 +00:00
parent 1d74ab1d33
commit a4addf17e8
2 changed files with 8 additions and 3 deletions

View File

@ -8,6 +8,7 @@
#include <unistd.h>
#include <config.h>
#include <string.h>
#include <math.h>
#ifdef WITH_DMALLOC
# include <dmalloc.h>
#endif
@ -41,6 +42,8 @@ if ((y + h) > ((yy) + (hh))) {h = (hh) - (y - yy);}
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define round(x) ((x)>=0?(int)((x)+0.5):(int)((x)-0.5))
#ifdef __EMX__
extern char *__XOS2RedirRoot(const char *);
#endif

View File

@ -52,12 +52,14 @@ xpm_parse_color(char *color, int *r, int *g, int *b)
/* look in rgb txt database */
if (!rgb_txt)
#ifndef __EMX__
rgb_txt = fopen("/usr/X11R6/lib/X11/rgb.txt", "r");
rgb_txt = fopen("/usr/X11R6/lib/X11/rgb.txt", "r");
if (!rgb_txt)
rgb_txt = fopen("/usr/openwin/lib/X11/rgb.txt", "r");
#else
rgb_txt = fopen(__XOS2RedirRoot("/XFree86/lib/X11/rgb.txt"), "rt");
rgb_txt = fopen(__XOS2RedirRoot("/XFree86/lib/X11/rgb.txt"), "rt");
#endif
if (!rgb_txt)
return;
return;
fseek(rgb_txt, 0, SEEK_SET);
while (fgets(buf, 4000, rgb_txt))
{