From http://www.jwz.org/xscreensaver/xscreensaver-5.35.tar.gz
[xscreensaver] / hacks / memscroller.c
index ddd07eed83c49609766691369d80a5d225eb108e..b1ca148644c290322b27c6b7fcdd18a5fd6aa508 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 2002-2012 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 2002-2015 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -21,7 +21,7 @@
 #undef countof
 #define countof(x) (sizeof(x)/sizeof(*(x)))
 
-#ifndef USE_IPHONE
+#ifndef HAVE_MOBILE
 # define READ_FILES
 #endif
 
@@ -302,6 +302,18 @@ open_file (state *st)
 #endif
 
 
+/* "The brk and sbrk functions are historical curiosities left over
+   from earlier days before the advent of virtual memory management."
+      -- sbrk(2) man page on BSD systems, as of 1995 or so.
+ */
+#ifdef HAVE_SBRK
+# if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 2)) /* gcc >= 4.2 */
+   /* Don't print "warning: 'sbrk' is deprecated". */
+#  pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+# endif
+#endif
+
+
 static unsigned int
 more_bits (state *st, scroller *sc)
 {
@@ -323,7 +335,7 @@ more_bits (state *st, scroller *sc)
   vv = sc->value;
 
   /* Pack RGB into a pixel according to the XImage component masks;
-     set the remaining bits to 1 for the benefit of HAVE_COCOA alpha.
+     set the remaining bits to 1 for the benefit of HAVE_JWXYZ alpha.
    */
 # undef PACK
 # define PACK() ((((r << 24) | (r << 16) | (r << 8) | r) & rmsk) | \
@@ -345,10 +357,6 @@ more_bits (state *st, scroller *sc)
         sc->data = lomem;
 
 # ifdef HAVE_SBRK  /* re-get it each time through */
-      /* "The brk and sbrk functions are historical curiosities left over
-         from earlier days before the advent of virtual memory management."
-            -- sbrk(2) man page on MacOS
-       */
       himem = ((unsigned char *) sbrk(0)) - (2 * sizeof(void *));
 # endif
 
@@ -360,7 +368,7 @@ more_bits (state *st, scroller *sc)
         }
 
       /* I don't understand what's going on there, but on MacOS X, we're
-         getting insane values for lomem and himem (both Xlib and HAVE_COCOA).
+         getting insane values for lomem and himem (both Xlib and HAVE_JWXYZ).
          Does malloc() draw from more than one heap? */
       if ((unsigned long) himem - (unsigned long) lomem > 0x0FFFFFFF) {
 # if 0
@@ -618,21 +626,21 @@ static const char *memscroller_defaults [] = {
   ".foreground:                   #00FF00",
   "*borderSize:                   2",
 
-#if defined(HAVE_COCOA) && !defined(USE_IPHONE)
-  ".font1:                OCR A Std 192, Lucida Console 192",
-  ".font2:                OCR A Std 144, Lucida Console 144",
-  ".font3:                OCR A Std 128, Lucida Console 128",
-  ".font4:                OCR A Std 96,  Lucida Console 96",
-  ".font5:                OCR A Std 48,  Lucida Console 48",
-  ".font6:                OCR A Std 24,  Lucida Console 24",
-#else  /* !HAVE_COCOA */
+#if defined(HAVE_COCOA) || defined(HAVE_ANDROID)
+  ".font1:                OCR A Std 192, Lucida Console 192, Monaco 192",
+  ".font2:                OCR A Std 144, Lucida Console 144, Monaco 144",
+  ".font3:                OCR A Std 128, Lucida Console 128, Monaco 128",
+  ".font4:                OCR A Std 96,  Lucida Console 96,  Monaco 96",
+  ".font5:                OCR A Std 48,  Lucida Console 48,  Monaco 48",
+  ".font6:                OCR A Std 24,  Lucida Console 24,  Monaco 24",
+#else  /* real X11 */
   ".font1:                -*-courier-bold-r-*-*-*-1440-*-*-m-*-*-*",
   ".font2:                -*-courier-bold-r-*-*-*-960-*-*-m-*-*-*",
   ".font3:                -*-courier-bold-r-*-*-*-480-*-*-m-*-*-*",
   ".font4:                -*-courier-bold-r-*-*-*-320-*-*-m-*-*-*",
   ".font5:                -*-courier-bold-r-*-*-*-180-*-*-m-*-*-*",
   ".font6:                fixed",
-#endif /* !HAVE_COCOA */
+#endif /* real X11 */
 
   "*delay:                10000",
   "*offset:               0",