changeset 5936:574f0cded429 cygwin

try to replace all nnnL or nnnUL constants with EMACS_[U]INT
author Henry Thompson <ht@markup.co.uk>
date Sun, 13 Dec 2015 13:22:58 +0000
parents d5eb0914ca1f
children 9e308c7501d1
files lib-src/movemail.c lib-src/pop.c lwlib/xlwgauge.c lwlib/xlwgcs.c lwlib/xlwmenu.c lwlib/xlwradio.c lwlib/xlwtabs.c src/alloc.c src/compiler.h src/console-impl.h src/data.c src/device-msw.c src/dumper.c src/emodules.c src/event-msw.c src/getloadavg.c src/glyphs-msw.c src/imgproc.h src/input-method-xlib.c src/lisp-disunion.h src/lisp.h src/ndir.h src/nt.c src/number-gmp.h src/number-mp.c src/number.c src/number.h src/redisplay-gtk.c src/redisplay-xlike-inc.c src/regex.c src/select-x.c src/sysdll.c src/syssignal.h src/syswindows.h src/termcap.c src/tls.c src/unexaix.c src/unexcw.c src/unexec.c
diffstat 39 files changed, 103 insertions(+), 96 deletions(-) [+]
line wrap: on
line diff
--- a/lib-src/movemail.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/lib-src/movemail.c	Sun Dec 13 13:22:58 2015 +0000
@@ -412,7 +412,7 @@
 #endif
 #ifdef HAVE_LOCKING
 	case LOCKING:
-	  if (locking (indesc, LK_RLCK, -1L) < 0)
+	  if (locking (indesc, LK_RLCK, -E1) < 0)
 	    pfatal_with_name (inname);
 	  break;
 #endif
@@ -458,7 +458,7 @@
 	case FLOCKING:
 	case LOCKING:
 #ifdef HAVE_FTRUNCATE
-	  ftruncate (indesc, 0L);
+	  ftruncate (indesc, E0);
 #else
 	  close (open (inname, O_CREAT | O_TRUNC | O_RDWR, 0666));
 #endif
--- a/lib-src/pop.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/lib-src/pop.c	Sun Dec 13 13:22:58 2015 +0000
@@ -1182,7 +1182,7 @@
 	}
 #else  /* ! KRB5 */	  
       ticket = (KTEXT) malloc (sizeof (KTEXT_ST));
-      rem = krb_sendauth (0L, sock, ticket, "pop", realhost,
+      rem = krb_sendauth (E0, sock, ticket, "pop", realhost,
 			  (char *) krb_realmofhost (realhost),
 			  (unsigned long) 0, &msg_data, &cred, schedule,
 			  (struct sockaddr_in *) 0,
--- a/lwlib/xlwgauge.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/lwlib/xlwgauge.c	Sun Dec 13 13:22:58 2015 +0000
@@ -1105,5 +1105,5 @@
 
 	values.foreground = fg ;
 
-	return XtAllocateGC((Widget)gw, 0, vmask, &values, 0L, umask) ;
+	return XtAllocateGC((Widget)gw, 0, vmask, &values, E0, umask) ;
 }
--- a/lwlib/xlwgcs.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/lwlib/xlwgcs.c	Sun Dec 13 13:22:58 2015 +0000
@@ -193,7 +193,7 @@
 		GCDashList|GCArcMode|GCBackground|GCGraphicsExposures ;
 	}
 
-	return XtAllocateGC(w, w->core.depth, vmask, &values, 0L, dcmask) ;
+	return XtAllocateGC(w, w->core.depth, vmask, &values, E0, dcmask) ;
 }
 
 
@@ -252,11 +252,11 @@
 	    values.stipple = getDitherPixmap(w, contrast) ;
 	  }
 
-	  return XtAllocateGC(w, w->core.depth, vmask, &values, 0L, dcmask) ;
+	  return XtAllocateGC(w, w->core.depth, vmask, &values, E0, dcmask) ;
 	} else {
 	  dcmask |= GCBackground ;
 	  values.foreground = AllocGreyPixel(w, fg, bg, contrast) ;
-	  return XtAllocateGC(w, w->core.depth, vmask, &values, 0L, dcmask) ;
+	  return XtAllocateGC(w, w->core.depth, vmask, &values, E0, dcmask) ;
 	}
 }
 
@@ -277,7 +277,7 @@
 
 	return XtAllocateGC(w, w->core.depth,
 	    GCForeground, &values,
-	    0L,
+	    E0,
 	    GCBackground|GCFont|GCSubwindowMode|GCGraphicsExposures|
 		GCDashOffset|GCDashList|GCArcMode) ;
 }
@@ -297,7 +297,7 @@
 
 	return XtAllocateGC(w, w->core.depth,
 	    GCForeground, &values,
-	    0L,
+	    E0,
 	    GCBackground|GCFont|GCSubwindowMode|GCGraphicsExposures|
 		GCDashOffset|GCDashList|GCArcMode) ;
 }
@@ -321,18 +321,18 @@
 	  else
 	    values.foreground = BlackPixelOfScreen(scr) ;
 	  values.fill_style = FillStippled ;
-	  values.stipple = XmuCreateStippledPixmap(XtScreen(w), 1L, 0L, 1) ;
+	  values.stipple = XmuCreateStippledPixmap(XtScreen(w), E1, E0, 1) ;
 
 	  return XtAllocateGC(w, w->core.depth,
 	      GCForeground|GCBackground|GCStipple|GCFillStyle,
-	      &values, 0L,
+	      &values, E0,
 	      GCFont|GCSubwindowMode|GCGraphicsExposures|
 		  GCDashOffset|GCDashList|GCArcMode) ;
 	} else {
 	  values.foreground = AllocShadowPixel(w, 100-contrast) ;
 	  return XtAllocateGC(w, w->core.depth,
 	      GCForeground, &values,
-	      0L,
+	      E0,
 	      GCBackground|GCFont|GCSubwindowMode|GCGraphicsExposures|
 		  GCDashOffset|GCDashList|GCArcMode) ;
 	}
@@ -510,7 +510,7 @@
 	else if( contrast <= 37 )
 	  return XCreateBitmapFromData(dpy,win, (char *)screen25, 2,2) ;
 	else if( contrast <= 62 )
-	  return XmuCreateStippledPixmap(XtScreen(w), 1L, 0L, 1) ;
+	  return XmuCreateStippledPixmap(XtScreen(w), E1, E0, 1) ;
 	else if( contrast <= 95 )
 	  return XCreateBitmapFromData(dpy,win, (char *)screen75, 2,2) ;
 	else
--- a/lwlib/xlwmenu.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/lwlib/xlwmenu.c	Sun Dec 13 13:22:58 2015 +0000
@@ -3648,7 +3648,7 @@
   if (!mw->menu.pointer_grabbed)
     {
       XWindowAttributes ret;
-      Window parent,root = 0UL;
+      Window parent,root = UE0;
       Window *waste = NULL;
       unsigned int num_waste;
 
--- a/lwlib/xlwradio.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/lwlib/xlwradio.c	Sun Dec 13 13:22:58 2015 +0000
@@ -330,7 +330,7 @@
 		     0,0, rw->label.lbm_width, rw->label.lbm_height,
 		     (int) rw->label.internal_width*2 + bs(rw),
 		     (int) rw->label.internal_height + rw->label.lbm_y,
-		     1UL) ;
+		     UE1) ;
 	}
 
 	/* Finally, the button itself */
--- a/lwlib/xlwtabs.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/lwlib/xlwtabs.c	Sun Dec 13 13:22:58 2015 +0000
@@ -1699,7 +1699,7 @@
 	    if (tab->tabs.lbm_depth == 1)
 	      XCopyPlane(dpy, tab->tabs.left_bitmap, win,gc,
 		0,0, tab->tabs.lbm_width, tab->tabs.lbm_height,
-		x+tab->tabs.lbm_x, y+tab->tabs.lbm_y, 1L);
+		x+tab->tabs.lbm_x, y+tab->tabs.lbm_y, E1);
 	    else
 	      XCopyArea(dpy, tab->tabs.left_bitmap, win,gc,
 		0,0, tab->tabs.lbm_width, tab->tabs.lbm_height,
@@ -2482,7 +2482,7 @@
 	{
 	  values.fill_style = FillStippled;
 	  tw->tabs.grey50 =
-	  values.stipple = XmuCreateStippledPixmap(XtScreen(w), 1L, 0L, 1);
+	  values.stipple = XmuCreateStippledPixmap(XtScreen(w), E1, E0, 1);
 
 	  tw->tabs.greyGC =
 	    XtAllocateGC(w, w->core.depth,
@@ -2502,7 +2502,7 @@
 	  tw->tabs.greyGC =
 	    XtAllocateGC(w, w->core.depth,
 #ifdef HAVE_XFT_TABS
-	      0L,
+	      E0,
 #else
 	      GCFont,
 #endif
--- a/src/alloc.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/alloc.c	Sun Dec 13 13:22:58 2015 +0000
@@ -1750,7 +1750,7 @@
   Lisp_Bigfloat *f;
 
   ALLOC_FROB_BLOCK_LISP_OBJECT (bigfloat, Lisp_Bigfloat, f, &lrecord_bigfloat);
-  if (precision == 0UL)
+  if (precision == UE0)
     bigfloat_init (bigfloat_data (f));
   else
     bigfloat_init_prec (bigfloat_data (f), precision);
--- a/src/compiler.h	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/compiler.h	Sun Dec 13 13:22:58 2015 +0000
@@ -333,4 +333,9 @@
    lvalue, so you can assign to it or take its address. */
 #define VOIDP_CAST(l)  ANSI_ALIASING_CAST (voidp, l)
 
+#ifndef E1
+/* HST added this, lives in lisp.h but needed in regex.c which includes this instead
+   of that for lib-src */
+#define E1 ((EMACS_INT)1)
+#endif
 #endif /* INCLUDED_compiler_h */
--- a/src/console-impl.h	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/console-impl.h	Sun Dec 13 13:22:58 2015 +0000
@@ -35,19 +35,19 @@
  */
 
 /* Set when device uses pixel-based geometry */
-#define XDEVIMPF_PIXEL_GEOMETRY		0x00000001L
+#define XDEVIMPF_PIXEL_GEOMETRY		E1
 
 /* Indicates that the device is a printer */
-#define XDEVIMPF_IS_A_PRINTER		0x00000002L
+#define XDEVIMPF_IS_A_PRINTER		((EMACS_INT)2)
 
 /* Do not automatically redisplay this device */
-#define XDEVIMPF_NO_AUTO_REDISPLAY	0x00000004L
+#define XDEVIMPF_NO_AUTO_REDISPLAY	((EMACS_INT)4)
 
 /* Do not delete the device when last frame's gone */
-#define XDEVIMPF_FRAMELESS_OK		0x00000008L
+#define XDEVIMPF_FRAMELESS_OK		((EMACS_INT)8)
 
 /* Do not preempt resiaply of frame or device once it starts */
-#define XDEVIMPF_DONT_PREEMPT_REDISPLAY 0x00000010L
+#define XDEVIMPF_DONT_PREEMPT_REDISPLAY ((EMACS_INT)10)
 
 struct console_methods
 {
--- a/src/data.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/data.c	Sun Dec 13 13:22:58 2015 +0000
@@ -1640,7 +1640,7 @@
 #ifdef WITH_NUMBER_TYPES
   REGISTER int i;
   /* Start with a bignum to avoid overflow */
-  Lisp_Object accum = make_bignum (1L), multiplier;
+  Lisp_Object accum = make_bignum (E1), multiplier;
 
   for (i = 0; i < nargs; i++)
     {
@@ -2491,7 +2491,7 @@
 #ifdef HAVE_BIGNUM
   if (BIGNUMP (number))
     {
-      bignum_set_long (scratch_bignum, 1L);
+      bignum_set_long (scratch_bignum, E1);
       bignum_add (scratch_bignum2, XBIGNUM_DATA (number), scratch_bignum);
       return Fcanonicalize_number (make_bignum_bg (scratch_bignum2));
     }
@@ -2499,7 +2499,7 @@
 #ifdef HAVE_RATIO
   if (RATIOP (number))
     {
-      ratio_set_long (scratch_ratio, 1L);
+      ratio_set_long (scratch_ratio, E1);
       ratio_add (scratch_ratio, XRATIO_DATA (number), scratch_ratio);
       /* No need to canonicalize after adding 1 */
       return make_ratio_rt (scratch_ratio);
@@ -2509,7 +2509,7 @@
   if (BIGFLOATP (number))
     {
       bigfloat_set_prec (scratch_bigfloat, XBIGFLOAT_GET_PREC (number));
-      bigfloat_set_long (scratch_bigfloat, 1L);
+      bigfloat_set_long (scratch_bigfloat, E1);
       bigfloat_add (scratch_bigfloat, XBIGFLOAT_DATA (number),
 		    scratch_bigfloat);
       return make_bigfloat_bf (scratch_bigfloat);
@@ -2535,7 +2535,7 @@
 #ifdef HAVE_BIGNUM
   if (BIGNUMP (number))
     {
-      bignum_set_long (scratch_bignum, 1L);
+      bignum_set_long (scratch_bignum, E1);
       bignum_sub (scratch_bignum2, XBIGNUM_DATA (number), scratch_bignum);
       return Fcanonicalize_number (make_bignum_bg (scratch_bignum2));
     }
@@ -2543,7 +2543,7 @@
 #ifdef HAVE_RATIO
   if (RATIOP (number))
     {
-      ratio_set_long (scratch_ratio, 1L);
+      ratio_set_long (scratch_ratio, E1);
       ratio_sub (scratch_ratio, XRATIO_DATA (number), scratch_ratio);
       /* No need to canonicalize after subtracting 1 */
       return make_ratio_rt (scratch_ratio);
@@ -2553,7 +2553,7 @@
   if (BIGFLOATP (number))
     {
       bigfloat_set_prec (scratch_bigfloat, XBIGFLOAT_GET_PREC (number));
-      bigfloat_set_long (scratch_bigfloat, 1L);
+      bigfloat_set_long (scratch_bigfloat, E1);
       bigfloat_sub (scratch_bigfloat, XBIGFLOAT_DATA (number),
 		    scratch_bigfloat);
       return make_bigfloat_bf (scratch_bigfloat);
--- a/src/device-msw.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/device-msw.c	Sun Dec 13 13:22:58 2015 +0000
@@ -247,7 +247,7 @@
     qxeDdeCreateStringHandle (mswindows_dde_mlid,
 			      XETEXT (MSWINDOWS_DDE_ITEM_OPEN),
 			      XEUNICODE_P ? CP_WINUNICODE : CP_WINANSI);
-  DdeNameService (mswindows_dde_mlid, mswindows_dde_service, 0L, DNS_REGISTER);
+  DdeNameService (mswindows_dde_mlid, mswindows_dde_service, E0, DNS_REGISTER);
 }
 #endif /* HAVE_DRAGNDROP */
 
@@ -283,7 +283,7 @@
 mswindows_delete_device (struct device *d)
 {
 #ifdef HAVE_DRAGNDROP
-  DdeNameService (mswindows_dde_mlid, 0L, 0L, DNS_UNREGISTER);
+  DdeNameService (mswindows_dde_mlid, E0, E0, DNS_UNREGISTER);
   DdeFreeStringHandle (mswindows_dde_mlid, mswindows_dde_item_result);
   DdeFreeStringHandle (mswindows_dde_mlid, mswindows_dde_item_open);
   DdeFreeStringHandle (mswindows_dde_mlid, mswindows_dde_topic_system);
--- a/src/dumper.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/dumper.c	Sun Dec 13 13:22:58 2015 +0000
@@ -2577,7 +2577,7 @@
 /* Unix 98 requires that sys/mman.h define MAP_FAILED,
    but many earlier implementations don't. */
 # ifndef MAP_FAILED
-#  define MAP_FAILED ((void *) -1L)
+#  define MAP_FAILED ((void *) -E1)
 # endif
   pdump_start =
     (Rawbyte *) mmap (0, pdump_length, PROT_READ|PROT_WRITE, MAP_PRIVATE,
--- a/src/emodules.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/emodules.c	Sun Dec 13 13:22:58 2015 +0000
@@ -379,7 +379,7 @@
 
   ellcc_rev = (const long *) dll_variable (dlhandle,
 					   (const Ibyte *) "emodule_compiler");
-  if (ellcc_rev == NULL || *ellcc_rev <= 0L)
+  if (ellcc_rev == NULL || *ellcc_rev <= E0)
     signal_error (Qdll_error, "Invalid dynamic module: Missing symbol `emodule_compiler'", Qunbound);
   if (*ellcc_rev > EMODULES_REVISION)
     signal_ferror (Qdll_error, "Invalid dynamic module: Unsupported version `%ld(%ld)'", *ellcc_rev, EMODULES_REVISION);
--- a/src/event-msw.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/event-msw.c	Sun Dec 13 13:22:58 2015 +0000
@@ -1915,7 +1915,7 @@
 	     || !DdeCmpStringHandles (hszTopic, mswindows_dde_topic_system)
 	     || !DdeCmpStringHandles (hszTopic, mswindows_dde_topic_eval)))
 	  return (DdeCreateDataHandle (mswindows_dde_mlid, (LPBYTE) pairs,
-				       sizeof (pairs), 0L, 0, uFmt, 0));
+				       sizeof (pairs), E0, 0, uFmt, 0));
       }
       return (HDDEDATA) NULL;
 
@@ -2025,7 +2025,7 @@
 	 * return back to the client, which signals an error as we wish.
 	 */
 	return DdeCreateDataHandle (mswindows_dde_mlid, (LPBYTE)result,
-				    bytes, 0L, hszItem, uFmt, 0);
+				    bytes, E0, hszItem, uFmt, 0);
       }
 
     case XTYP_EXECUTE:
--- a/src/getloadavg.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/getloadavg.c	Sun Dec 13 13:22:58 2015 +0000
@@ -597,7 +597,7 @@
     {
       /* Try to read the load.  */
 #  ifndef SUNOS_5
-      if (lseek (channel, offset, 0) == -1L
+      if (lseek (channel, offset, 0) == -E1
 	  || retry_read (channel, (char *) load_ave, sizeof (load_ave))
 	  != sizeof (load_ave))
 	{
--- a/src/glyphs-msw.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/glyphs-msw.c	Sun Dec 13 13:22:58 2015 +0000
@@ -152,7 +152,7 @@
     }
 }
 
-#define BPLINE(width) ((int)(~3UL & (unsigned long)((width) +3)))
+#define BPLINE(width) ((int)(~((EMACS_UINT)3) & (unsigned long)((width) +3)))
 
 /************************************************************************/
 /* convert from a series of RGB triples to a BITMAPINFO formated for the*/
@@ -837,7 +837,7 @@
 
   *width = xpmimage.width;
   *height = xpmimage.height;
-  maskbpline = BPLINE ((~7UL & (unsigned long)(*width + 7)) / 8);
+  maskbpline = BPLINE ((~((EMACS_UINT)7) & (unsigned long)(*width + 7)) / 8);
 
   *data = xnew_array_and_zero (Binbyte, *width * *height * 3);
 
--- a/src/imgproc.h	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/imgproc.h	Sun Dec 13 13:22:58 2015 +0000
@@ -28,10 +28,10 @@
 #define	MAX_COLOR	256
 
 #define	B_DEPTH		5		/* # bits/pixel to use */
-#define	B_LEN		(1L<<B_DEPTH)
+#define	B_LEN		(E1<<B_DEPTH)
 
 #define	C_DEPTH		2
-#define	C_LEN		(1L<<C_DEPTH)	/* # cells/color to use */
+#define	C_LEN		(E1<<C_DEPTH)	/* # cells/color to use */
 
 #define	COLOR_SHIFT	(COLOR_DEPTH-B_DEPTH)
 
--- a/src/input-method-xlib.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/input-method-xlib.c	Sun Dec 13 13:22:58 2015 +0000
@@ -530,12 +530,12 @@
   new_event.window = x_key_event->window;
   new_event.message_type = wc_atom;
   new_event.format = 32;  /* 32-bit wide data */
-  new_event.data.l[2] = new_event.data.l[3] = new_event.data.l[4] = 0L;
+  new_event.data.l[2] = new_event.data.l[3] = new_event.data.l[4] = E0;
   new_event.data.l[0] = x_key_event->time;
   for (i = 0; i < len; i++)
     {
       new_event.data.l[1] = ((wchar_t *) composed_input_buf.data)[i];
-      XSendEvent (display, main_window, False, 0L, (XEvent *) &new_event);
+      XSendEvent (display, main_window, False, E0, (XEvent *) &new_event);
     }
 }
 #endif /* 0 */
--- a/src/lisp-disunion.h	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/lisp-disunion.h	Sun Dec 13 13:22:58 2015 +0000
@@ -77,7 +77,7 @@
 typedef EMACS_INT Lisp_Object;
 
 #define Lisp_Type_Fixnum_Bit (Lisp_Type_Fixnum_Even & Lisp_Type_Fixnum_Odd)
-#define VALMASK ((((uintptr_t)1UL << VALBITS) - 1UL) << GCTYPEBITS)
+#define VALMASK ((((uintptr_t)UE1 << VALBITS) - 1UL) << GCTYPEBITS)
 #define XTYPE(x) ((enum Lisp_Type) (((EMACS_UINT)(x)) & ~VALMASK))
 #define XPNTRVAL(x) (x) /* This depends on Lisp_Type_Record == 0 */
 #define XCHARVAL(x) ((x) >> GCBITS)
--- a/src/lisp.h	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/lisp.h	Sun Dec 13 13:22:58 2015 +0000
@@ -488,7 +488,9 @@
 #endif
 
 /* HST added to save space/typing/be more transparent, I hope */
+#define E0 ((EMACS_INT)0)
 #define E1 ((EMACS_INT)1)
+#define UE0 ((EMACS_UINT)0)
 #define UE1 ((EMACS_UINT)1)
 
 #define BITS_PER_EMACS_INT (SIZEOF_EMACS_INT * BITS_PER_CHAR)
--- a/src/ndir.h	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/ndir.h	Sun Dec 13 13:22:58 2015 +0000
@@ -59,7 +59,7 @@
 long telldir (DIR *dirp);
 void seekdir (DIR *dirp, long loc);
 
-#define rewinddir( dirp )	seekdir( dirp, 0L )
+#define rewinddir( dirp )	seekdir( dirp, E0 )
 
 #endif /* WIN32_NATIVE */
 
--- a/src/nt.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/nt.c	Sun Dec 13 13:22:58 2015 +0000
@@ -541,7 +541,7 @@
   _ftime (&tb);
 
   tv->tv_sec = tb.time;
-  tv->tv_usec = tb.millitm * 1000L;
+  tv->tv_usec = tb.millitm * (EMACS_INT)1000;
   if (tz) 
     {
       tz->tz_minuteswest = tb.timezone;	/* minutes west of Greenwich  */
--- a/src/number-gmp.h	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/number-gmp.h	Sun Dec 13 13:22:58 2015 +0000
@@ -165,8 +165,8 @@
 /***** Ratio: converting assignments *****/
 #define ratio_set(r1,r2)                mpq_set (r1, r2)
 #define ratio_set_string(r,s,base)      mpq_set_str (r, s, base)
-#define ratio_set_long(r,l)             mpq_set_si (r, l, 1UL)
-#define ratio_set_ulong(r,l)            mpq_set_ui (r, l, 1UL)
+#define ratio_set_long(r,l)             mpq_set_si (r, l, UE1)
+#define ratio_set_ulong(r,l)            mpq_set_ui (r, l, UE1)
 #define ratio_set_double(r,f)           mpq_set_d (r, f)
 #define ratio_set_bignum(r,b)           mpq_set_z (r, b)
 #define ratio_set_bigfloat(r,f)         mpq_set_f (r, f)
--- a/src/number-mp.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/number-mp.c	Sun Dec 13 13:22:58 2015 +0000
@@ -144,7 +144,7 @@
 bignum_to_long (bignum b)
 {
   short rem, sign;
-  unsigned long retval = 0L;
+  unsigned long retval = E0;
   REGISTER unsigned int i;
   MINT *quo;
 
@@ -157,7 +157,7 @@
 bignum_to_ulong (bignum b)
 {
   short rem, sign;
-  unsigned long retval = 0UL;
+  unsigned long retval = UE0;
   REGISTER unsigned int i;
   MINT *quo;
 
@@ -183,7 +183,7 @@
 bignum_to_ullong (bignum b)
 {
   short rem, sign;
-  unsigned long long retval = 0UL;
+  unsigned long long retval = UE0;
   REGISTER unsigned int i;
   MINT *quo;
 
@@ -290,7 +290,7 @@
 {
   char hex[SIZEOF_LONG * 2U + 2U];
   MINT *temp;
-  int neg = l < 0L;
+  int neg = l < E0;
 
   snprintf (hex, SIZEOF_LONG * 2U + 2U, "%lx",
 	    neg ? (unsigned long) -l : (unsigned long) l);
@@ -353,7 +353,7 @@
   MP_MOVE (bignum_zero, b);
   if (negative)
     d = -d;
-  for (i = 0UL; d > 0.0; d /= 256, i++)
+  for (i = UE0; d > 0.0; d /= 256, i++)
     {
       MINT *temp = MP_ITOM ((short) fmod (d, 256.0));
       MP_MULT (multiplier, temp, temp);
@@ -433,7 +433,7 @@
 bignum_pow (bignum result, bignum n, unsigned long pow)
 {
   MP_MOVE (bignum_one, result);
-  for ( ; pow > 0UL; pow--)
+  for ( ; pow > UE0; pow--)
     MP_MULT (result, n, result);
 }
 
@@ -464,7 +464,7 @@
 									\
   MP_MOVE (bignum_zero, result);					\
 									\
-  for (i = 0UL; MP_MCMP (bignum_zero, n1) < 0 &&			\
+  for (i = UE0; MP_MCMP (bignum_zero, n1) < 0 &&			\
 	 MP_MCMP (bignum_zero, n2) < 0; i++)				\
     {									\
       short byte1, byte2;						\
@@ -515,7 +515,7 @@
 
   MP_MOVE (bignum_zero, result);
 
-  for (i = 0UL; MP_MCMP (bignum_zero, n) < 0; i++)
+  for (i = UE0; MP_MCMP (bignum_zero, n) < 0; i++)
     {
       short byte;
       MINT *temp;
--- a/src/number.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/number.c	Sun Dec 13 13:22:58 2015 +0000
@@ -389,7 +389,7 @@
 	args_out_of_range_3 (*val, Qzero, Vbigfloat_max_prec);
       prec = bignum_to_ulong (XBIGNUM_DATA (*val));
     }
-  if (prec != 0UL)
+  if (prec != UE0)
     bigfloat_set_default_prec (prec);
 #endif
   return 0;
@@ -406,7 +406,7 @@
     return make_float (d);
 #ifdef HAVE_BIGFLOAT
   else
-    return make_bigfloat (d, 0UL);
+    return make_bigfloat (d, UE0);
 #endif
 }
 
@@ -442,7 +442,7 @@
 #ifdef HAVE_RATIO
   if (RATIOP (number) &&
       bignum_fits_long_p (XRATIO_DENOMINATOR (number)) &&
-      bignum_to_long (XRATIO_DENOMINATOR (number)) == 1L)
+      bignum_to_long (XRATIO_DENOMINATOR (number)) == E1)
     number = Fcanonicalize_number (make_bignum_bg (XRATIO_NUMERATOR (number)));
 #endif
 #ifdef HAVE_BIGNUM
@@ -542,7 +542,7 @@
 	  return number;
 	case RATIO_T:
 #ifdef HAVE_RATIO
-	  bignum_set_long (scratch_bignum, 1L);
+	  bignum_set_long (scratch_bignum, E1);
 	  return make_ratio_bg (XBIGNUM_DATA (number), scratch_bignum);
 #else
 	  ABORT ();
@@ -690,7 +690,7 @@
 				      type2 == BIGFLOAT_T
 				      ? XBIGFLOAT_GET_PREC (*arg2) :
 #endif
-				      0UL);
+				      UE0);
       return type2;
     }
 
@@ -701,7 +701,7 @@
 				      type1 == BIGFLOAT_T
 				      ? XBIGFLOAT_GET_PREC (*arg1) :
 #endif
-				      0UL);
+				      UE0);
       return type1;
     }
 
@@ -726,24 +726,24 @@
 {
   CHECK_SYMBOL (type);
   if (EQ (type, Qfixnum))
-    return internal_coerce_number (number, FIXNUM_T, 0UL);
+    return internal_coerce_number (number, FIXNUM_T, UE0);
   else if (EQ (type, Qinteger))
     {
       /* If bignums are available, we always convert to one first, then
 	 downgrade to a fixnum if possible. */
 #ifdef HAVE_BIGNUM
       return Fcanonicalize_number
-	(internal_coerce_number (number, BIGNUM_T, 0UL));
+	(internal_coerce_number (number, BIGNUM_T, UE0));
 #else
-      return internal_coerce_number (number, FIXNUM_T, 0UL);
+      return internal_coerce_number (number, FIXNUM_T, UE0);
 #endif
     }
 #ifdef HAVE_RATIO
   else if (EQ (type, Qratio))
-    return internal_coerce_number (number, RATIO_T, 0UL);
+    return internal_coerce_number (number, RATIO_T, UE0);
 #endif
   else if (EQ (type, Qfloat))
-    return internal_coerce_number (number, FLOAT_T, 0UL);
+    return internal_coerce_number (number, FLOAT_T, UE0);
 #ifdef HAVE_BIGFLOAT
   else if (EQ (type, Qbigfloat))
     {
@@ -858,7 +858,7 @@
 reinit_vars_of_number (void)
 {
 #if defined(HAVE_BIGFLOAT) && defined(HAVE_BIGNUM)
-  Vbigfloat_max_prec = make_bignum (0L);
+  Vbigfloat_max_prec = make_bignum (E0);
   bignum_set_ulong (XBIGNUM_DATA (Vbigfloat_max_prec), ULONG_MAX);
 #endif
 }
--- a/src/number.h	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/number.h	Sun Dec 13 13:22:58 2015 +0000
@@ -221,14 +221,14 @@
 
 #define RATIO_ARITH_RETURN(r,op) do			\
 {							\
-  Lisp_Object retval = make_ratio (0L, 1UL);		\
+  Lisp_Object retval = make_ratio (E0, UE1);		\
   ratio_##op (XRATIO_DATA (retval), XRATIO_DATA (r));	\
   return Fcanonicalize_number (retval);			\
 } while (0)
 
 #define RATIO_ARITH_RETURN1(r,op,arg) do			\
 {								\
-  Lisp_Object retval = make_ratio (0L, 1UL);			\
+  Lisp_Object retval = make_ratio (E0, UE1);			\
   ratio_##op (XRATIO_DATA (retval), XRATIO_DATA (r), arg);	\
   return Fcanonicalize_number (retval);				\
 } while (0)
--- a/src/redisplay-gtk.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/redisplay-gtk.c	Sun Dec 13 13:22:58 2015 +0000
@@ -174,5 +174,5 @@
 	     gc_private->xgc,
 	     xsrc, ysrc,
 	     width, height,
-	     xdest, ydest, 1L);
+	     xdest, ydest, E1);
 }
--- a/src/redisplay-xlike-inc.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/redisplay-xlike-inc.c	Sun Dec 13 13:22:58 2015 +0000
@@ -1698,7 +1698,7 @@
 #ifdef THIS_IS_X
       XCopyPlane (dpy, IMAGE_INSTANCE_X_PIXMAP_SLICE
 		  (p, IMAGE_INSTANCE_PIXMAP_SLICE (p)), x_win, gc,
-		  xoffset, yoffset, width, height, x, y, 1L);
+		  xoffset, yoffset, width, height, x, y, E1);
 #else /* THIS_IS_GTK */
       USED (dpy);
       our_draw_bitmap (GDK_DRAWABLE (x_win), gc,
--- a/src/regex.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/regex.c	Sun Dec 13 13:22:58 2015 +0000
@@ -1889,7 +1889,7 @@
 /* This is not an arbitrary limit: the arguments which represent offsets
    into the pattern are two bytes long.  So if 2^16 bytes turns out to
    be too small, many things would have to change.  */
-#define MAX_BUF_SIZE (1L << 16)
+#define MAX_BUF_SIZE (E1 << 16)
 
 
 /* Extend the buffer by twice its current size via realloc and
--- a/src/select-x.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/select-x.c	Sun Dec 13 13:22:58 2015 +0000
@@ -455,7 +455,7 @@
   reply.target    = event->target;
   reply.property  = None;
 
-  XSendEvent (reply.display, reply.requestor, False, 0L, (XEvent *) &reply);
+  XSendEvent (reply.display, reply.requestor, False, E0, (XEvent *) &reply);
   XFlush (reply.display);
 }
 
@@ -518,7 +518,7 @@
       XChangeProperty (display, window, reply.property, type, format,
 		       PropModeReplace, data, size);
       /* At this point, the selection was successfully stored; ack it. */
-      XSendEvent (display, window, False, 0L, (XEvent *) &reply);
+      XSendEvent (display, window, False, E0, (XEvent *) &reply);
       XFlush (display);
     }
   else
@@ -568,7 +568,7 @@
 		       &bytes_remaining, 1);
       XSelectInput (display, window, PropertyChangeMask);
       /* Tell 'em the INCR data is there... */
-      XSendEvent (display, window, False, 0L, (XEvent *) &reply);
+      XSendEvent (display, window, False, E0, (XEvent *) &reply);
       XFlush (display);
 
       /* First, wait for the requestor to ack by deleting the property.
@@ -604,7 +604,7 @@
 #endif
       if (! waiting_for_other_props_on_window (display, window))
       {
-	XSelectInput (display, window, 0L);
+	XSelectInput (display, window, E0);
 	XtUnregisterDrawable(display, (Drawable)window);
       }
       XChangeProperty (display, window, reply.property, type, format,
--- a/src/sysdll.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/sysdll.c	Sun Dec 13 13:22:58 2015 +0000
@@ -134,7 +134,7 @@
     {
       soname = LISP_STRING_TO_EXTERNAL (fname, Qdll_filename_encoding);
     }
-  return (dll_handle) shl_load (soname, BIND_DEFERRED, 0L);
+  return (dll_handle) shl_load (soname, BIND_DEFERRED, E0);
 }
 
 int
@@ -146,7 +146,7 @@
 dll_func
 dll_function (dll_handle h, const CIbyte *n)
 {
-  long handle = 0L;
+  long handle = E0;
 
   if (shl_findsym ((shl_t *) &h, n, TYPE_PROCEDURE, &handle))
     return NULL;
@@ -157,7 +157,7 @@
 dll_var
 dll_variable (dll_handle h, const CIbyte *n)
 {
-  long handle = 0L;
+  long handle = E0;
 
   if (shl_findsym ((shl_t *) &h, n, TYPE_DATA, &handle))
     return NULL;
--- a/src/syssignal.h	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/syssignal.h	Sun Dec 13 13:22:58 2015 +0000
@@ -158,7 +158,7 @@
 
 /* Is it necessary to define sigmask like this? */
 #ifndef sigmask
-# define sigmask(no) (1L << ((no) - 1))
+# define sigmask(no) (E1 << ((no) - 1))
 #endif
 
 #define EMACS_BLOCK_SIGNAL(sig) sigblock (sigmask (sig))
--- a/src/syswindows.h	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/syswindows.h	Sun Dec 13 13:22:58 2015 +0000
@@ -961,7 +961,7 @@
 #define qxeCreateWindow(lpClassName, lpWindowName, dwStyle, x, y,	     \
                         nWidth, nHeight, hWndParent, hMenu, hInstance,	     \
 			lpParam)					     \
-  qxeCreateWindowEx (0L, lpClassName, lpWindowName, dwStyle, x, y,	     \
+  qxeCreateWindowEx (E0, lpClassName, lpWindowName, dwStyle, x, y,	     \
                      nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam)
 
 /* ------------------------- Unicode conversion ------------------------- */
@@ -1359,7 +1359,7 @@
 /* To prevent zero-initialized variables from being placed into the bss
    section, use non-zero values to represent an uninitialized state.  */
 #define UNINIT_PTR ((unsigned char*) 0xF0A0F0A0)
-#define UNINIT_LONG (0xF0A0F0A0L)
+#define UNINIT_LONG ((EMACS_INT)0xF0A0F0A0)
 
 /* Recreate the heap created during dumping.  */
 void recreate_heap (Extbyte *executable_path);
--- a/src/termcap.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/termcap.c	Sun Dec 13 13:22:58 2015 +0000
@@ -476,7 +476,7 @@
   bufp->ateof = 0;
   *bufp->ptr = 0;
 
-  lseek (fd, 0L, 0);
+  lseek (fd, E0, 0);
 
   while (!bufp->ateof)
     {
--- a/src/tls.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/tls.c	Sun Dec 13 13:22:58 2015 +0000
@@ -803,7 +803,7 @@
 openssl_report_error_stack (const char *msg, const SSL *ssl)
 {
   unsigned long err = ERR_get_error ();
-  if (err > 0UL)
+  if (err > UE0)
     {
       if (ERR_GET_LIB (err) == ERR_LIB_SSL &&
 	  ERR_GET_REASON (err) == SSL_R_CERTIFICATE_VERIFY_FAILED)
@@ -854,7 +854,7 @@
       err = 1;
       break;
     case SSL_ERROR_SYSCALL:
-      if (openssl_report_error_stack (msg, ssl) == 0UL && ret < 0)
+      if (openssl_report_error_stack (msg, ssl) == UE0 && ret < 0)
 	warn_when_safe (Qtls_error, Qerror, "%s: %s", msg,
 			strerror (errno_copy));
       err = ret;
--- a/src/unexaix.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/unexaix.c	Sun Dec 13 13:22:58 2015 +0000
@@ -89,7 +89,7 @@
 
 static long text_scnptr;
 static long data_scnptr;
-#define ALIGN(val, pwr) (((val) + ((1L<<(pwr))-1)) & ~((1L<<(pwr))-1))
+#define ALIGN(val, pwr) (((val) + ((E1<<(pwr))-1)) & ~((E1<<(pwr))-1))
 static long load_scnptr;
 static long orig_load_scnptr;
 static long orig_data_scnptr;
@@ -380,7 +380,7 @@
 	}
     }
 
-  if (f_hdr.f_symptr > 0L)
+  if (f_hdr.f_symptr > E0)
     {
       f_hdr.f_symptr += bias;
     }
@@ -487,7 +487,7 @@
   if (a_out < 0)
     return 0;
 
-  if (orig_load_scnptr == 0L)
+  if (orig_load_scnptr == E0)
     return 0;
 
   if (lnnoptr && lnnoptr < orig_load_scnptr) /* if there is line number info  */
--- a/src/unexcw.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/unexcw.c	Sun Dec 13 13:22:58 2015 +0000
@@ -59,7 +59,7 @@
 /* To prevent zero-initialized variables from being placed into the bss
    section, use non-zero values to represent an uninitialized state.  */
 #define UNINIT_PTR ((void *) 0xF0A0F0A0)
-#define UNINIT_LONG (0xF0A0F0A0L)
+#define UNINIT_LONG ((EMACS_INT)0xF0A0F0A0)
 
 static void get_section_info (int a_out, char* a_name);
 static void copy_executable_and_dump_data_section (int a_out, int a_new);
--- a/src/unexec.c	Sat Dec 12 21:49:31 2015 +0000
+++ b/src/unexec.c	Sun Dec 13 13:22:58 2015 +0000
@@ -455,7 +455,7 @@
 	  {
 	    PERROR (a_name);
 	  }
-	if (scntemp.s_scnptr > 0L)
+	if (scntemp.s_scnptr > E0)
 	  {
             if (block_copy_start < scntemp.s_scnptr + scntemp.s_size)
 	      block_copy_start = scntemp.s_scnptr + scntemp.s_size;
@@ -519,17 +519,17 @@
   f_bhdr.s_paddr = f_ohdr.data_start + f_ohdr.dsize;
   f_bhdr.s_vaddr = f_ohdr.data_start + f_ohdr.dsize;
   f_bhdr.s_size = f_ohdr.bsize;
-  f_bhdr.s_scnptr = 0L;
+  f_bhdr.s_scnptr = E0;
 #ifndef USG_SHARED_LIBRARIES
   bias = f_dhdr.s_scnptr + f_dhdr.s_size - block_copy_start;
 #endif
 
-  if (f_hdr.f_symptr > 0L)
+  if (f_hdr.f_symptr > E0)
     {
       f_hdr.f_symptr += bias;
     }
 
-  if (f_thdr.s_lnnoptr > 0L)
+  if (f_thdr.s_lnnoptr > E0)
     {
       f_thdr.s_lnnoptr += bias;
     }
@@ -876,7 +876,7 @@
     return 0;
 
 #ifdef COFF
-  if (SYMS_START == 0L)
+  if (SYMS_START == E0)
     return 0;
 #endif  /* COFF */