From: Heiga Z. <hei...@us...> - 2007-10-16 02:21:38
|
Update of /cvsroot/sp-tk/SPTK/src/bin/xgr In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv11613/src/bin/xgr Modified Files: plot.c window.c xgr.c Log Message: Arrange spaces for macros. Wrap strrchr() by rindex() if string.h does not exist. Index: window.c =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/bin/xgr/window.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** window.c 3 Oct 2007 16:51:12 -0000 1.10 --- window.c 16 Oct 2007 02:20:53 -0000 1.11 *************** *** 56,63 **** #include <stdio.h> #include <stdlib.h> ! #include <string.h> #include "gcdata.h" #include "xgr.h" Display *display; Window main_window; --- 56,73 ---- #include <stdio.h> #include <stdlib.h> ! ! #ifdef HAVE_STRING_H ! # include <string.h> ! #else ! # include <strings.h> ! # ifndef HAVE_STRRCHR ! # define strrchr rindex ! # endif ! #endif ! #include "gcdata.h" #include "xgr.h" + Display *display; Window main_window; *************** *** 106,114 **** screen = DefaultScreen(display); ! #if BSD bzero(&xsh, sizeof(xsh)); #else memset(&xsh, 0, sizeof(xsh)); #endif if (geometry) { int bitmask; --- 116,125 ---- screen = DefaultScreen(display); ! #if defined(HAVE_BZERO) && !defined(HAVE_MEMSET) bzero(&xsh, sizeof(xsh)); #else memset(&xsh, 0, sizeof(xsh)); #endif + if (geometry) { int bitmask; Index: plot.c =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/bin/xgr/plot.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** plot.c 5 Oct 2007 18:21:42 -0000 1.14 --- plot.c 16 Oct 2007 02:20:53 -0000 1.15 *************** *** 203,212 **** n_max = ++w * ++h; n_plot = (density * n_max) / LEVEL; - - #if BSD - bzero((char *)flg, sizeof(*flg)*POINTS); - #else memset(flg, 0, sizeof(*flg)*POINTS); - #endif for (n=0; n<n_plot; n++) { --- 203,207 ---- Index: xgr.c =================================================================== RCS file: /cvsroot/sp-tk/SPTK/src/bin/xgr/xgr.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** xgr.c 30 Sep 2007 18:37:52 -0000 1.15 --- xgr.c 16 Oct 2007 02:20:53 -0000 1.16 *************** *** 79,95 **** #include <stdio.h> #include <stdlib.h> - #include "xgr.h" - - typedef enum _Boolean {FA, TR} Boolean; - char *BOOL[] = {"FALSE", "TRUE"}; ! #if HAS_STDLIB ! #include <strings.h> /* for rindex() */ ! #define RINDEX(s, c) rindex(s, c) #else ! #include <string.h> ! #define RINDEX(s, c) strrchr(s, c) #endif /* Defalut Value */ #define LANDSCAPE FA --- 79,94 ---- #include <stdio.h> #include <stdlib.h> ! #ifdef HAVE_STRING_H ! # include <string.h> #else ! # include <strings.h> ! # ifndef HAVE_STRRCHR ! # define strrchr rindex ! # endif #endif + #include "xgr.h" + /* Defalut Value */ #define LANDSCAPE FA *************** *** 106,109 **** --- 105,111 ---- #define DISPLAY NULL + typedef enum _Boolean {FA, TR} Boolean; + char *BOOL[] = {"FALSE", "TRUE"}; + /* Command Name */ char *cmnd; *************** *** 151,156 **** cmnd = windowtitle = *argv; ! if (RINDEX(cmnd, '/')) ! cmnd = windowtitle = (char *)(RINDEX(cmnd, '/') + 1); while (--argc) { --- 153,158 ---- cmnd = windowtitle = *argv; ! if (strrchr(cmnd, '/')) ! cmnd = windowtitle = (char *)(strrchr(cmnd, '/') + 1); while (--argc) { |