Changeset 1391 for branches/GNU/src/gcc/libobjc/gc.c
- Timestamp:
- Apr 27, 2004, 8:39:34 PM (21 years ago)
- Location:
- branches/GNU/src/gcc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gcc
- Property svn:ignore
-
old new 26 26 configure.vr 27 27 configure.vrs 28 dir.info 28 29 Makefile 29 dir.info30 30 lost+found 31 31 update.out
-
- Property svn:ignore
-
branches/GNU/src/gcc/libobjc/gc.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r1390 r1391 1 1 /* Basic data types for Objective C. 2 Copyright (C) 1998 Free Software Foundation, Inc.2 Copyright (C) 1998, 2002 Free Software Foundation, Inc. 3 3 Contributed by Ovidiu Predescu. 4 4 … … 59 59 60 60 #define ROUND(V, A) \ 61 ({ typeof (V) __v=(V); typeof(A) __a=(A); \62 __a *((__v+__a-1)/__a); })61 ({ typeof (V) __v = (V); typeof (A) __a = (A); \ 62 __a * ((__v+__a - 1)/__a); }) 63 63 64 64 #define SET_BIT_FOR_OFFSET(mask, offset) \ 65 GC_set_bit (mask, offset / sizeof (void*))65 GC_set_bit (mask, offset / sizeof (void *)) 66 66 67 67 /* Some prototypes */ … … 75 75 __objc_gc_setup_array (GC_bitmap mask, const char *type, int offset) 76 76 { 77 int i, len = atoi (type + 1);78 79 while (isdigit (*++type))77 int i, len = atoi (type + 1); 78 79 while (isdigit (*++type)) 80 80 /* do nothing */; /* skip the size of the array */ 81 81 … … 139 139 case _C_CHARPTR: 140 140 case _C_ATOM: 141 if (! gc_invisible)142 SET_BIT_FOR_OFFSET (mask, position);141 if (! gc_invisible) 142 SET_BIT_FOR_OFFSET (mask, position); 143 143 break; 144 144 … … 179 179 align = objc_alignof_type (type); 180 180 181 offset = ROUND (offset, align);182 for (i = 0; i < size; i += sizeof (void *))183 { 184 SET_BIT_FOR_OFFSET (mask, offset);185 offset += sizeof (void *);181 offset = ROUND (offset, align); 182 for (i = 0; i < size; i += sizeof (void *)) 183 { 184 SET_BIT_FOR_OFFSET (mask, offset); 185 offset += sizeof (void *); 186 186 } 187 187 } … … 224 224 case _C_PTR: 225 225 case _C_CHARPTR: 226 if (! gc_invisible)227 SET_BIT_FOR_OFFSET (mask, offset);226 if (! gc_invisible) 227 SET_BIT_FOR_OFFSET (mask, offset); 228 228 break; 229 229 … … 255 255 { 256 256 int i, ivar_count; 257 struct objc_ivar_list *ivars;258 259 if (! class)257 struct objc_ivar_list *ivars; 258 259 if (! class) 260 260 { 261 261 strcat (*type, "{"); … … 268 268 269 269 ivars = class->ivars; 270 if (! ivars)270 if (! ivars) 271 271 return; 272 272 … … 283 283 /* Increase the size of the encoding string so that it 284 284 contains this ivar's type. */ 285 *size = ROUND (*current + len + 1, 10);285 *size = ROUND (*current + len + 1, 10); 286 286 *type = objc_realloc (*type, *size); 287 287 } … … 303 303 char *class_structure_type; 304 304 305 if (! CLS_ISCLASS(class))305 if (! CLS_ISCLASS (class)) 306 306 return; 307 307 … … 312 312 /* The number of bits in the mask is the size of an instance in bytes divided 313 313 by the size of a pointer. */ 314 bits_no = (ROUND (class_get_instance_size (class), sizeof(void*))315 / sizeof (void *));316 size = ROUND (bits_no, BITS_PER_WORD) / BITS_PER_WORD;314 bits_no = (ROUND (class_get_instance_size (class), sizeof (void *)) 315 / sizeof (void *)); 316 size = ROUND (bits_no, BITS_PER_WORD) / BITS_PER_WORD; 317 317 mask = objc_atomic_malloc (size * sizeof (int)); 318 318 memset (mask, 0, size * sizeof (int)); … … 343 343 #endif 344 344 345 class->gc_object_type = (void *)GC_make_descriptor (mask, bits_no);345 class->gc_object_type = (void *) GC_make_descriptor (mask, bits_no); 346 346 } 347 347 … … 371 371 pointers. */ 372 372 void 373 class_ivar_set_gcinvisible (Class class, const char *ivarname,373 class_ivar_set_gcinvisible (Class class, const char *ivarname, 374 374 BOOL gc_invisible) 375 375 { 376 376 int i, ivar_count; 377 struct objc_ivar_list *ivars;378 379 if (! class || !ivarname)377 struct objc_ivar_list *ivars; 378 379 if (! class || ! ivarname) 380 380 return; 381 381 382 382 ivars = class->ivars; 383 if (! ivars)383 if (! ivars) 384 384 return; 385 385 … … 391 391 const char *type; 392 392 393 if (! ivar->ivar_name || strcmp (ivar->ivar_name, ivarname))393 if (! ivar->ivar_name || strcmp (ivar->ivar_name, ivarname)) 394 394 continue; 395 395 … … 408 408 char *new_type; 409 409 410 if (gc_invisible || ! __objc_ivar_pointer (type))410 if (gc_invisible || ! __objc_ivar_pointer (type)) 411 411 return; /* The type of the variable already matches the 412 412 requested gc_invisible type */ … … 423 423 char *new_type; 424 424 425 if (! gc_invisible || !__objc_ivar_pointer (type))425 if (! gc_invisible || ! __objc_ivar_pointer (type)) 426 426 return; /* The type of the variable already matches the 427 427 requested gc_invisible type */ … … 447 447 448 448 void 449 __objc_generate_gc_type_description (Class class )450 { 451 } 452 453 void class_ivar_set_gcinvisible (Class class ,454 const char * ivarname,455 BOOL gc_invisible )449 __objc_generate_gc_type_description (Class class __attribute__ ((__unused__))) 450 { 451 } 452 453 void class_ivar_set_gcinvisible (Class class __attribute__ ((__unused__)), 454 const char *ivarname __attribute__ ((__unused__)), 455 BOOL gc_invisible __attribute__ ((__unused__))) 456 456 { 457 457 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.