Permalink
Browse files

Fix most of 'might be clobbered' warnings

Thaks to: http://lists.apple.com/archives/xcode-users/2003/Dec//msg00050.htm
'' it's normally enough just to change their scope.''
  • Loading branch information...
1 parent c35607d commit 02ca078fcb5792a3155b289d861ed84948b72ebd @NotFound NotFound committed Jan 27, 2011
Showing with 10 additions and 9 deletions.
  1. +10 −9 src/embed/embed_private.h
View
@@ -1,5 +1,5 @@
/* api.h
- * Copyright (C) 2001-2010, Parrot Foundation.
+ * Copyright (C) 2001-2011, Parrot Foundation.
* Overview:
* Parrot embed API's private macros
*/
@@ -9,23 +9,24 @@
#include "pmc/pmc_parrotinterpreter.h"
-#define GET_RAW_INTERP(p) ((Parrot_ParrotInterpreter_attributes*)(p)->data)->interp;
-#define GET_INTERP(p) PMC_IS_NULL(p) ? NULL : GET_RAW_INTERP(p);
+/* Don't add ';' at the end of these macros.
+ * they are expressions, not statements */
+#define GET_RAW_INTERP(p) (((Parrot_ParrotInterpreter_attributes*)(p)->data)->interp)
+#define GET_INTERP(p) (PMC_IS_NULL(p) ? NULL : GET_RAW_INTERP(p))
#define EMBED_API_CALLIN(p, i) \
- void * _oldtop; \
Parrot_jump_buff env; \
- Interp * const (i) = GET_INTERP(p); \
- _oldtop = (i)->lo_var_ptr; \
- if (_oldtop == NULL) \
- (i)->lo_var_ptr = &_oldtop; \
- (i)->api_jmp_buf = &env; \
if (setjmp(env)) { \
Interp * const __interp = GET_INTERP(p); \
__interp->api_jmp_buf = NULL; \
return !__interp->exit_code; \
} \
else { \
+ Interp * const (i) = GET_INTERP(p); \
+ void * _oldtop = (i)->lo_var_ptr; \
+ if (_oldtop == NULL) \
+ (i)->lo_var_ptr = &_oldtop; \
+ (i)->api_jmp_buf = &env; \
{
#define EMBED_API_CALLOUT(p, i) \

1 comment on commit 02ca078

Owner

NotFound commented on 02ca078 Jan 27, 2011

Forgot to mention in the commit message: TT #1981

Please sign in to comment.