@@ -29,15 +29,15 @@ #endif static void init(void) { - if ((emptyLevel2 = malloc(sizeof(struct objc_dtable_level2))) == NULL) + if ((emptyLevel2 = malloc(sizeof(*emptyLevel2))) == NULL) OBJC_ERROR("Not enough memory to allocate dtable!"); #ifdef OF_SELUID24 - if ((emptyLevel3 = malloc(sizeof(struct objc_dtable_level3))) == NULL) + if ((emptyLevel3 = malloc(sizeof(*emptyLevel3))) == NULL) OBJC_ERROR("Not enough memory to allocate dtable!"); #endif #ifdef OF_SELUID24 for (uint_fast16_t i = 0; i < 256; i++) { @@ -61,11 +61,11 @@ #else if (emptyLevel2 == NULL) init(); #endif - if ((DTable = malloc(sizeof(struct objc_dtable))) == NULL) + if ((DTable = malloc(sizeof(*DTable))) == NULL) OBJC_ERROR("Not enough memory to allocate dtable!"); for (uint_fast16_t i = 0; i < 256; i++) DTable->buckets[i] = emptyLevel2; @@ -125,12 +125,11 @@ uint8_t i = idx >> 8; uint8_t j = idx; #endif if (DTable->buckets[i] == emptyLevel2) { - struct objc_dtable_level2 *level2 = - malloc(sizeof(struct objc_dtable_level2)); + struct objc_dtable_level2 *level2 = malloc(sizeof(*level2)); if (level2 == NULL) OBJC_ERROR("Not enough memory to insert into dtable!"); for (uint_fast16_t l = 0; l < 256; l++) @@ -143,12 +142,11 @@ DTable->buckets[i] = level2; } #ifdef OF_SELUID24 if (DTable->buckets[i]->buckets[j] == emptyLevel3) { - struct objc_dtable_level3 *level3 = - malloc(sizeof(struct objc_dtable_level3)); + struct objc_dtable_level3 *level3 = malloc(sizeof(*level3)); if (level3 == NULL) OBJC_ERROR("Not enough memory to insert into dtable!"); for (uint_fast16_t l = 0; l < 256; l++)