Skip to content
Browse files

Avoiding use of compound literals in args to memcpy, as it may be a m…

…acro (e.g. on Mac)
  • Loading branch information...
1 parent 29691f5 commit 0d5a3127529613ba2f7d3ef20e0ff62c1104eb43 @superjer committed Mar 8, 2012
Showing with 6 additions and 5 deletions.
  1. +6 −5 game/obj_ghost.c
View
11 game/obj_ghost.c
@@ -38,17 +38,18 @@ void obj_ghost_adv( int objid, Uint32 a, Uint32 b, OBJ_t *oa, OBJ_t *ob )
PLAYER_t *pl = fr[b].objs[gh->avatar].data;
CONTEXT_t *co = fr[b].objs[ob->context].data;
- if( gh->client==me )
- {
+ if( gh->client==me ) {
myghost = objid;
mycontext = ob->context;
}
+ static V v2_dimetric[2] = {{-64,-72,-64},{64, 0, 64}};
+ static V v2_ortho[2] = {{-NATIVEW/2,-NATIVEH/2,0},{NATIVEW/2,NATIVEH/2,0}};
+
if( co->projection == DIMETRIC )
- memcpy( gh->hull, (V[2]){{-64,-72,-64},{64, 0, 64}}, sizeof (V[2]) );
+ memcpy( gh->hull, v2_dimetric, sizeof (V[2]) );
if( co->projection == ORTHOGRAPHIC )
- memcpy( gh->hull, (V[2]){{-NATIVEW/2,-NATIVEH/2,0},{NATIVEW/2,NATIVEH/2,0}}, sizeof (V[2]) );
-
+ memcpy( gh->hull, v2_ortho, sizeof (V[2]) );
FCMD_t *c = fr[b].cmds + gh->client;

0 comments on commit 0d5a312

Please sign in to comment.
Something went wrong with that request. Please try again.