[Pkg-erlang-commits] r1370 - in libsdl-erlang/trunk/debian: . patches

sgolovan at alioth.debian.org sgolovan at alioth.debian.org
Fri Dec 16 21:47:57 UTC 2011


Author: sgolovan
Date: 2011-12-16 21:47:56 +0000 (Fri, 16 Dec 2011)
New Revision: 1370

Modified:
   libsdl-erlang/trunk/debian/changelog
   libsdl-erlang/trunk/debian/patches/driver.patch
Log:
[esdl]
  * Enhanced driver loading patch.


Modified: libsdl-erlang/trunk/debian/changelog
===================================================================
--- libsdl-erlang/trunk/debian/changelog	2011-12-16 20:42:14 UTC (rev 1369)
+++ libsdl-erlang/trunk/debian/changelog	2011-12-16 21:47:56 UTC (rev 1370)
@@ -5,7 +5,7 @@
   * Fixed loading driver esdl_driver into Erlang R15B.
   * Upload to experimental as Erlang R15B is there yet.
 
- -- Sergei Golovan <sgolovan at debian.org>  Fri, 16 Dec 2011 13:09:57 +0400
+ -- Sergei Golovan <sgolovan at debian.org>  Sat, 17 Dec 2011 01:46:37 +0400
 
 esdl (1.0.1-3) unstable; urgency=low
 

Modified: libsdl-erlang/trunk/debian/patches/driver.patch
===================================================================
--- libsdl-erlang/trunk/debian/patches/driver.patch	2011-12-16 20:42:14 UTC (rev 1369)
+++ libsdl-erlang/trunk/debian/patches/driver.patch	2011-12-16 21:47:56 UTC (rev 1370)
@@ -2,7 +2,28 @@
 
 --- esdl-1.0.1.orig/c_src/esdl_driver.c
 +++ esdl-1.0.1/c_src/esdl_driver.c
-@@ -59,6 +59,17 @@
+@@ -32,13 +32,18 @@
+ 
+ #include "esdl.h"
+ 
++#if ERL_DRV_EXTENDED_MAJOR_VERSION < 2
++typedef int ErlDrvSizeT;
++typedef int ErlDrvSSizeT;
++#endif
++
+ #define TEMP_BINARY_SIZE 512
+ 
+ static ErlDrvData sdl_driver_start(ErlDrvPort port, char *buff);
+ static void sdl_driver_stop(ErlDrvData handle);
+ static void sdl_driver_finish(void);
+-static int sdl_driver_control(ErlDrvData handle, unsigned int command, 
+-			      char* buf, int count, char** res, int res_size);
++static ErlDrvSSizeT sdl_driver_control(ErlDrvData handle, unsigned int command, 
++				       char* buf, ErlDrvSizeT count, char** res, ErlDrvSizeT res_size);
+ static void standard_outputv(ErlDrvData drv_data, ErlIOVec *ev);
+ 
+ /*
+@@ -59,6 +64,17 @@
      sdl_driver_control,    /* F_PTR control, port_control callback */
      NULL,                  /* F_PTR timeout, reserved */
      standard_outputv,	   /* F_PTR outputv, reserved */
@@ -20,3 +41,53 @@
  };
  
  DRIVER_INIT(sdl_driver)
+@@ -148,9 +164,9 @@
+ {
+ }
+ 
+-static int
++static ErlDrvSSizeT
+ sdl_driver_control(ErlDrvData handle, unsigned op,
+-		   char* buf, int count, char** res, int res_size)
++		   char* buf, ErlDrvSizeT count, char** res, ErlDrvSizeT res_size)
+ {
+   sdl_data* sd = (sdl_data *) handle;
+   sdl_fun func;
+@@ -159,14 +175,14 @@
+   sd->len = 0;
+   sd->op = op;
+   func = sd->fun_tab[op];
+-  func(sd, count, buf);
++  func(sd, (int)count, buf);
+   (*res) = sd->buff;
+-  return sd->len;
++  return (ErlDrvSSizeT)(sd->len);
+ }
+ 
+-static int
++static ErlDrvSSizeT
+ sdl_driver_debug_control(ErlDrvData handle, unsigned op,
+-			 char* buf, int count, char** res, int res_size)
++			 char* buf, ErlDrvSizeT count, char** res, ErlDrvSizeT res_size)
+ {
+   sdl_data* sd = (sdl_data *) handle;
+   sdl_fun func;
+@@ -178,15 +194,15 @@
+   fprintf(stderr, "Command:%d:%s: ", op, sd->str_tab[op]);
+   func = sd->fun_tab[op];
+ 
+-  func(sd, count, buf);
++  func(sd, (int)count, buf);
+   if ((len = sd->len) >= 0) {
+     fprintf(stderr, "ok\r\n");
+     (*res) = sd->buff;
+-    return len;
++    return (ErlDrvSSizeT)len;
+   } else {
+     fprintf(stderr, "error\r\n");
+     *res = 0;
+-    return -1;
++    return (ErlDrvSSizeT)(-1);
+   }
+ }
+ 




More information about the Pkg-erlang-commits mailing list