emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Please install and ack


From: Johannes Weiner
Subject: Re: Please install and ack
Date: Wed, 12 Sep 2007 12:08:11 +0200
User-agent: Mutt/1.5.16 (2007-06-11)

Hi,

On Tue, Sep 11, 2007 at 04:31:51PM -0400, Richard Stallman wrote:
> --- src/xterm.c.orig  2007-05-25 12:43:35.000000000 +0000
> +++ src/xterm.c       2007-08-31 03:43:32.106444418 +0000
>  
> +#ifndef abs
>  #define abs(x)       ((x) < 0 ? -(x) : (x))
> +#endif
>  
> --- src/keyboard.c.orig       2007-04-01 21:54:54.000000000 +0000
> +++ src/keyboard.c    2007-08-31 03:43:32.291971223 +0000
>  
> +#ifndef abs
>  #define abs(x)               ((x) >= 0 ? (x) : -(x))
> +#endif
>  
> --- src/xfaces.c.orig 2007-02-14 15:47:51.000000000 +0000
> +++ src/xfaces.c      2007-09-06 18:17:56.728517424 +0000
>
> -
> +#ifndef abs
>  #define abs(X)               ((X) < 0 ? -(X) : (X))
> -
> +#endif

Wouldn't it be better to centralize that macro?  It's trivial, sure.  But
repetition is not beautiful.  I have a patch attached, but I'm not quite sure
if config.h is the place to do this..

        Hannes
Index: configure.in
===================================================================
RCS file: /sources/emacs/emacs/configure.in,v
retrieving revision 1.474
diff -u -r1.474 configure.in
--- configure.in        12 Sep 2007 07:03:30 -0000      1.474
+++ configure.in        12 Sep 2007 09:58:33 -0000
@@ -2729,7 +2729,7 @@
 AC_CHECK_FUNCS(gethostname getdomainname dup2 \
 rename closedir mkdir rmdir sysinfo getrusage get_current_dir_name \
 random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \
-strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
+strerror fpathconf select mktime euidaccess getpagesize tzset setlocale abs \
 utimes setrlimit setpgid getcwd getwd shutdown getaddrinfo \
 __fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
 sendto recvfrom getsockopt setsockopt getsockname getpeername \
@@ -3375,6 +3375,10 @@
 #define BCMP memcmp
 #endif
 
+#ifndef HAVE_ABS
+#define abs(x) ((x) < 0 ? -(x) : (x))
+#endif
+
 #endif /* EMACS_CONFIG_H */
 
 /*
Index: src/keyboard.c
===================================================================
RCS file: /sources/emacs/emacs/src/keyboard.c,v
retrieving revision 1.913
diff -u -r1.913 keyboard.c
--- src/keyboard.c      12 Sep 2007 07:19:55 -0000      1.913
+++ src/keyboard.c      12 Sep 2007 09:58:47 -0000
@@ -108,8 +108,6 @@
 #define KBD_BUFFER_SIZE 4096
 #endif /* No X-windows */
 
-#define abs(x)         ((x) >= 0 ? (x) : -(x))
-
 /* Following definition copied from eval.c */
 
 struct backtrace
Index: src/sound.c
===================================================================
RCS file: /sources/emacs/emacs/src/sound.c,v
retrieving revision 1.45
diff -u -r1.45 sound.c
--- src/sound.c 26 Jul 2007 05:27:56 -0000      1.45
+++ src/sound.c 12 Sep 2007 09:58:48 -0000
@@ -96,9 +96,6 @@
 
 #endif /* WINDOWSNT */
 
-/* BEGIN: Common Definitions */
-#define abs(X)    ((X) < 0 ? -(X) : (X))
-
 /* Symbols.  */
 
 extern Lisp_Object QCfile, QCdata;
Index: src/w32term.c
===================================================================
RCS file: /sources/emacs/emacs/src/w32term.c,v
retrieving revision 1.265
diff -u -r1.265 w32term.c
--- src/w32term.c       4 Sep 2007 21:38:40 -0000       1.265
+++ src/w32term.c       12 Sep 2007 09:58:48 -0000
@@ -58,8 +58,6 @@
 #include "composite.h"
 #include "coding.h"
 
-#define abs(x) ((x) < 0 ? -(x) : (x))
-
 
 /* Fringe bitmaps.  */
 
Index: src/xfaces.c
===================================================================
RCS file: /sources/emacs/emacs/src/xfaces.c,v
retrieving revision 1.364
diff -u -r1.364 xfaces.c
--- src/xfaces.c        29 Aug 2007 21:46:05 -0000      1.364
+++ src/xfaces.c        12 Sep 2007 09:58:48 -0000
@@ -267,8 +267,6 @@
 
 #include <ctype.h>
 
-#define abs(X)         ((X) < 0 ? -(X) : (X))
-
 /* Number of pt per inch (from the TeXbook).  */
 
 #define PT_PER_INCH 72.27
Index: src/xterm.c
===================================================================
RCS file: /sources/emacs/emacs/src/xterm.c,v
retrieving revision 1.956
diff -u -r1.956 xterm.c
--- src/xterm.c 10 Sep 2007 21:25:32 -0000      1.956
+++ src/xterm.c 12 Sep 2007 09:58:48 -0000
@@ -154,8 +154,6 @@
 #endif
 #endif
 
-#define abs(x) ((x) < 0 ? -(x) : (x))
-
 /* Default to using XIM if available.  */
 #ifdef USE_XIM
 int use_xim = 1;

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]