Update of /cvsroot/arcem/arcem/macosx
In directory vz-cvs-4.sog:/tmp/cvs-serv13637/macosx

Modified Files:
        ControlPane.c DispKbd.c 
Log Message:
* Add ControlPane_Error() function to allow errors to be reported in a 
platform-specific way.
* Replace numerous fprintf(stderr,"Foo"); exit(1); calls with calls to 
ControlPane_Error()
RISC OS specific changes:
* Add support for running in 32bpp modes (e.g. for Raspberry Pi)
* Allow tweak menu keys to be configured
* Fix stdout redirection preventing tweak menu from being visible!



Index: ControlPane.c
===================================================================
RCS file: /cvsroot/arcem/arcem/macosx/ControlPane.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ControlPane.c       9 May 2003 10:54:56 -0000       1.2
+++ ControlPane.c       21 Oct 2012 16:59:32 -0000      1.3
@@ -8,7 +8,20 @@
 #include "DispKbd.h"
 #include "ControlPane.h"
 
+#include <stdarg.h>
+#include <stdio.h>
+
 void ControlPane_Init(ARMul_State *state)
 {
 
 }
+
+void ControlPane_Error(int code,const char *fmt,...)
+{
+  va_list args;
+  va_start(args,fmt);
+  /* Log it */
+  vfprintf(stderr,fmt,args);
+  /* Quit */
+  exit(code);
+}

Index: DispKbd.c
===================================================================
RCS file: /cvsroot/arcem/arcem/macosx/DispKbd.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- DispKbd.c   12 May 2012 17:34:51 -0000      1.13
+++ DispKbd.c   21 Oct 2012 16:59:32 -0000      1.14
@@ -31,6 +31,7 @@
 #include "arch/DispKbd.h"
 #include "win.h"
 #include "KeyTable.h"
+#include "ControlPane.h"
 
 #ifndef BIG_ENDIAN
 #define BIG_ENDIAN
@@ -762,15 +763,13 @@
 {
   HD.ImageData=malloc(4*(MonitorWidth+32)*MonitorHeight);
   if (HD.ImageData==NULL) {
-    fprintf(stderr,"DisplayKbd_Init: Couldn't allocate image memory\n");
-    exit(1);
+    ControlPane_Error(1,"DisplayKbd_Init: Couldn't allocate image memory\n");
   };
 
   /* Now the same for the cursor image */
   HD.CursorImageData=malloc(4*64*MonitorHeight);
   if (HD.CursorImageData==NULL) {
-    fprintf(stderr,"DisplayKbd_Init: Couldn't allocate cursor image memory\n");
-    exit(1);
+    ControlPane_Error(1,"DisplayKbd_Init: Couldn't allocate cursor image 
memory\n");
   };
 
   GenerateInvertedKeyTable();


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
-- 
arcem-cvs mailing list
arcem-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/arcem-cvs

Reply via email to