changeset 987:297f2e790e57

Added a DW_RESOURCE() macro for typecasting parameters to HICN and for doing bounds checking. Fixed a typo in the template file while I was fixing comments.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Sat, 07 May 2011 06:06:19 +0000
parents 87dc0f5f96d0
children 56077b50be7e
files dw.h template/dw.c
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/dw.h	Sat May 07 05:14:06 2011 +0000
+++ b/dw.h	Sat May 07 06:06:19 2011 +0000
@@ -1402,6 +1402,9 @@
 #define DW_HTML_STOP       5
 #define DW_HTML_PRINT      6
 
+/* Macro for casting resource IDs to HICN */
+#define DW_RESOURCE(a) (a < 65536 ? (HICN)a : (HICN)0)
+
 #ifndef API
 #define API
 #endif
--- a/template/dw.c	Sat May 07 05:14:06 2011 +0000
+++ b/template/dw.c	Sat May 07 06:06:19 2011 +0000
@@ -3170,7 +3170,7 @@
  */
 int dw_event_wait(HEV eve, unsigned long timeout)
 {
-   return DW_ERROR_GENERAL
+   return DW_ERROR_GENERAL;
 }
 
 /*