[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemacs-commit] qemacs qe.c
From: |
Charlie Gordon |
Subject: |
[Qemacs-commit] qemacs qe.c |
Date: |
Thu, 24 Apr 2008 11:43:16 +0000 |
CVSROOT: /cvsroot/qemacs
Module name: qemacs
Changes by: Charlie Gordon <chqrlie> 08/04/24 11:43:16
Modified files:
. : qe.c
Log message:
got rid of some ugly casts
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qemacs/qe.c?cvsroot=qemacs&r1=1.92&r2=1.93
Patches:
Index: qe.c
===================================================================
RCS file: /cvsroot/qemacs/qemacs/qe.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -b -r1.92 -r1.93
--- qe.c 23 Apr 2008 15:30:33 -0000 1.92
+++ qe.c 24 Apr 2008 11:43:15 -0000 1.93
@@ -7582,13 +7582,12 @@
ptr = (int (**)(void))(void *)&__initcall_first;
for (;;) {
- /* NOTE: if bound checking is on, a '\0' is inserted between
- each initialized 'void *' */
#if defined(__BOUNDS_CHECKING_ON)
- ptr = (void **)((long)ptr + (2 * sizeof(void *)));
-#else
+ /* NOTE: if bound checking is on, a NULL is inserted between
+ each initialized 'void *' */
ptr++;
#endif
+ ptr++;
initcall = *ptr;
if (initcall == NULL)
break;
@@ -7606,10 +7605,11 @@
ptr = (int (**)(void))(void *)&__exitcall_first;
for (;;) {
#if defined(__BOUNDS_CHECKING_ON)
- ptr = (void **)((long)ptr + (2 * sizeof(void *)));
-#else
+ /* NOTE: if bound checking is on, a NULL is inserted between
+ each initialized 'void *' */
ptr++;
#endif
+ ptr++;
exitcall = *ptr;
if (exitcall == NULL)
break;
@@ -7673,9 +7673,10 @@
* Corrigendum 1) workaround; see the Rationale for the
* POSIX specification of dlsym().
*/
- *(void **)(&init_func) = dlsym(h, "__qe_module_init");
+ *(void **)&init_func = dlsym(h, "__qe_module_init");
//init_func = (int (*)(void))dlsym(h, "__qe_module_init");
#else
+ /* This kludge gets rid of compile and lint warnings */
sym = dlsym(h, "__qe_module_init");
memcpy(&init_func, &sym, sizeof(sym));
#endif