$NetBSD: patch-ae,v 1.3 2011/09/19 07:15:52 dholland Exp $

- use modern C
- return something from the error handler insertion routines (caught by clang)
- fix a format string (caught by clang)

--- lib/Xmc/ErrHndlr.c.orig	1998-02-01 19:03:30.000000000 +0000
+++ lib/Xmc/ErrHndlr.c
@@ -21,6 +21,7 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 #include <stdio.h>
+#include <stdlib.h>
 #include <xmc.h>
 #include <xmclib.h>
 #include <xmcp.h>
@@ -44,10 +45,14 @@ XmcSetErrorHandler
    DB XmcErrorHandler handler
    DE
 {
+   XmcErrorHandler prev;
+
+   prev = error_handler;
    if (handler)
       error_handler = handler;
    else
       error_handler = default_eh;
+   return prev;
 }
 
 XmcIOErrorHandler
@@ -56,10 +61,14 @@ XmcSetIOErrorHandler
    DB XmcIOErrorHandler handler
    DE
 {
+   XmcIOErrorHandler prev;
+
+   prev = io_error_handler;
    if (handler)
       io_error_handler = handler;
    else
       io_error_handler = default_io_eh;
+   return prev;
 }
 
 void
@@ -121,7 +130,7 @@ default_eh
    fprintf(stderr, "XMC Protocol Error:\n");
    fprintf(stderr, "\tcode %d\n", ep->errorCode);
    fprintf(stderr, "\trequest code %d\n", ep->opcode);
-   fprintf(stderr, "\tdata 0x%08x\n", ep->data);
+   fprintf(stderr, "\tdata 0x%08lx\n", ep->data);
    exit(1);
 }
 
