• Home
  • Raw
  • Download

Lines Matching +full:clang +full:- +full:analyzer

1 // Protocol Buffers - Google's data interchange format
3 // https://developers.google.com/protocol-buffers/
44 // protos can turn on -Wdirect-ivar-access without issues.
45 #pragma clang diagnostic push
46 #pragma clang diagnostic ignored "-Wdirect-ivar-access"
97 for (GPBFieldDescriptor *field in descriptor->fields_) {
199 // -- About Version Checks --
262 // GPB*Dictionary/NSDictionary all support -count;
276 GPBMessageFieldDescription *fieldDesc = field->description_;
279 uint8_t *storage = (uint8_t *)self->messageStorage_;
280 id *typePtr = (id *)&storage[fieldDesc->offset];
287 GPBSetHasIvar(self, fieldDesc->hasIndex, fieldDesc->number, NO);
296 GPBFieldDescriptor *firstField = oneof->fields_[0];
297 GPBMaybeClearOneofPrivate(self, oneof, firstField->description_->hasIndex, 0);
301 NSCAssert(self->messageStorage_ != NULL,
306 BOOL hasIvar = (self->messageStorage_->_has_storage_[-idx] == fieldNumber);
313 (self->messageStorage_->_has_storage_[byteIndex] & bitMask) ? YES : NO;
321 uint32_t result = self->messageStorage_->_has_storage_[-idx];
329 uint32_t *has_storage = self->messageStorage_->_has_storage_;
330 has_storage[-idx] = (value ? fieldNumber : 0);
333 uint32_t *has_storage = self->messageStorage_->_has_storage_;
361 uint8_t *storage = (uint8_t *)self->messageStorage_;
362 id *typePtr = (id *)&storage[fieldSet->description_->offset];
372 #pragma mark - IVar accessors
374 //%PDDM-DEFINE IVAR_POD_ACCESSORS_DEFN(NAME, TYPE)
389 //% uint8_t *storage = (uint8_t *)self->messageStorage_;
390 //% TYPE *typePtr = (TYPE *)&storage[field->description_->offset];
419 //% GPBOneofDescriptor *oneof = field->containingOneof_;
420 //% GPBMessageFieldDescription *fieldDesc = field->description_;
422 //% GPBMaybeClearOneofPrivate(self, oneof, fieldDesc->hasIndex, fieldDesc->number);
425 //% NSCAssert(self->messageStorage_ != NULL,
430 //% if (self->messageStorage_ == NULL) return;
432 //% uint8_t *storage = (uint8_t *)self->messageStorage_;
433 //% TYPE *typePtr = (TYPE *)&storage[fieldDesc->offset];
438 //% || ((fieldDesc->flags & GPBFieldClearHasIvarOnZero) == 0));
439 //% GPBSetHasIvar(self, fieldDesc->hasIndex, fieldDesc->number, hasValue);
443 //%PDDM-DEFINE IVAR_ALIAS_DEFN_OBJECT(NAME, TYPE)
473 //%PDDM-DEFINE IVAR_ALIAS_DEFN_COPY_OBJECT(NAME, TYPE)
512 uint8_t *storage = (uint8_t *)self->messageStorage_;
513 id *typePtr = (id *)&storage[field->description_->offset];
530 // GPBSetCopyObjectIvarWithField is blocked from the analyzer because it flags
531 // a leak for the -copy even though GPBSetRetainedObjectIvarWithFieldPrivate
533 // with the -retain in GPBSetObjectIvarWithField.
551 NSCAssert(self->messageStorage_ != NULL,
555 if (self->messageStorage_ == NULL) return;
564 // as there is no way to set a non-empty default value for messages.
575 NSString *hasSel = NSStringFromSelector(field->hasOrCountSel_);
589 GPBMessageFieldDescription *fieldDesc = field->description_;
593 GPBOneofDescriptor *oneof = field->containingOneof_;
595 GPBMaybeClearOneofPrivate(self, oneof, fieldDesc->hasIndex, fieldDesc->number);
601 if (((fieldDesc->flags & GPBFieldClearHasIvarOnZero) != 0) &&
609 GPBSetHasIvar(self, fieldDesc->hasIndex, fieldDesc->number, setHasValue);
611 uint8_t *storage = (uint8_t *)self->messageStorage_;
612 id *typePtr = (id *)&storage[fieldDesc->offset];
625 if (autoArray->_autocreator == self) {
626 autoArray->_autocreator = nil;
632 if (gpbArray->_autocreator == self) {
633 gpbArray->_autocreator = nil;
642 if (autoDict->_autocreator == self) {
643 autoDict->_autocreator = nil;
649 if (gpbDict->_autocreator == self) {
650 gpbDict->_autocreator = nil;
669 if (self->messageStorage_ == nil) {
672 uint8_t *storage = (uint8_t *)self->messageStorage_;
673 id *typePtr = (id *)&storage[field->description_->offset];
759 GPBMessageFieldDescription *fieldDesc = field->description_;
760 return GPBGetHasIvar(self, (int32_t)(fieldDesc->offset), fieldDesc->number);
787 GPBMessageFieldDescription *fieldDesc = field->description_;
788 GPBOneofDescriptor *oneof = field->containingOneof_;
790 GPBMaybeClearOneofPrivate(self, oneof, fieldDesc->hasIndex, fieldDesc->number);
797 GPBSetHasIvar(self, (int32_t)(fieldDesc->offset), fieldDesc->number, value);
802 || ((fieldDesc->flags & GPBFieldClearHasIvarOnZero) == 0));
803 GPBSetHasIvar(self, fieldDesc->hasIndex, fieldDesc->number, hasValue);
807 //%PDDM-EXPAND IVAR_POD_ACCESSORS_DEFN(Int32, int32_t)
809 // clang-format off
825 uint8_t *storage = (uint8_t *)self->messageStorage_;
826 int32_t *typePtr = (int32_t *)&storage[field->description_->offset];
855 GPBOneofDescriptor *oneof = field->containingOneof_;
856 GPBMessageFieldDescription *fieldDesc = field->description_;
858 GPBMaybeClearOneofPrivate(self, oneof, fieldDesc->hasIndex, fieldDesc->number);
861 NSCAssert(self->messageStorage_ != NULL,
866 if (self->messageStorage_ == NULL) return;
868 uint8_t *storage = (uint8_t *)self->messageStorage_;
869 int32_t *typePtr = (int32_t *)&storage[fieldDesc->offset];
874 || ((fieldDesc->flags & GPBFieldClearHasIvarOnZero) == 0));
875 GPBSetHasIvar(self, fieldDesc->hasIndex, fieldDesc->number, hasValue);
879 // clang-format on
880 //%PDDM-EXPAND IVAR_POD_ACCESSORS_DEFN(UInt32, uint32_t)
882 // clang-format off
898 uint8_t *storage = (uint8_t *)self->messageStorage_;
899 uint32_t *typePtr = (uint32_t *)&storage[field->description_->offset];
928 GPBOneofDescriptor *oneof = field->containingOneof_;
929 GPBMessageFieldDescription *fieldDesc = field->description_;
931 GPBMaybeClearOneofPrivate(self, oneof, fieldDesc->hasIndex, fieldDesc->number);
934 NSCAssert(self->messageStorage_ != NULL,
939 if (self->messageStorage_ == NULL) return;
941 uint8_t *storage = (uint8_t *)self->messageStorage_;
942 uint32_t *typePtr = (uint32_t *)&storage[fieldDesc->offset];
947 || ((fieldDesc->flags & GPBFieldClearHasIvarOnZero) == 0));
948 GPBSetHasIvar(self, fieldDesc->hasIndex, fieldDesc->number, hasValue);
952 // clang-format on
953 //%PDDM-EXPAND IVAR_POD_ACCESSORS_DEFN(Int64, int64_t)
955 // clang-format off
971 uint8_t *storage = (uint8_t *)self->messageStorage_;
972 int64_t *typePtr = (int64_t *)&storage[field->description_->offset];
1001 GPBOneofDescriptor *oneof = field->containingOneof_;
1002 GPBMessageFieldDescription *fieldDesc = field->description_;
1004 GPBMaybeClearOneofPrivate(self, oneof, fieldDesc->hasIndex, fieldDesc->number);
1007 NSCAssert(self->messageStorage_ != NULL,
1012 if (self->messageStorage_ == NULL) return;
1014 uint8_t *storage = (uint8_t *)self->messageStorage_;
1015 int64_t *typePtr = (int64_t *)&storage[fieldDesc->offset];
1020 || ((fieldDesc->flags & GPBFieldClearHasIvarOnZero) == 0));
1021 GPBSetHasIvar(self, fieldDesc->hasIndex, fieldDesc->number, hasValue);
1025 // clang-format on
1026 //%PDDM-EXPAND IVAR_POD_ACCESSORS_DEFN(UInt64, uint64_t)
1028 // clang-format off
1044 uint8_t *storage = (uint8_t *)self->messageStorage_;
1045 uint64_t *typePtr = (uint64_t *)&storage[field->description_->offset];
1074 GPBOneofDescriptor *oneof = field->containingOneof_;
1075 GPBMessageFieldDescription *fieldDesc = field->description_;
1077 GPBMaybeClearOneofPrivate(self, oneof, fieldDesc->hasIndex, fieldDesc->number);
1080 NSCAssert(self->messageStorage_ != NULL,
1085 if (self->messageStorage_ == NULL) return;
1087 uint8_t *storage = (uint8_t *)self->messageStorage_;
1088 uint64_t *typePtr = (uint64_t *)&storage[fieldDesc->offset];
1093 || ((fieldDesc->flags & GPBFieldClearHasIvarOnZero) == 0));
1094 GPBSetHasIvar(self, fieldDesc->hasIndex, fieldDesc->number, hasValue);
1098 // clang-format on
1099 //%PDDM-EXPAND IVAR_POD_ACCESSORS_DEFN(Float, float)
1101 // clang-format off
1117 uint8_t *storage = (uint8_t *)self->messageStorage_;
1118 float *typePtr = (float *)&storage[field->description_->offset];
1147 GPBOneofDescriptor *oneof = field->containingOneof_;
1148 GPBMessageFieldDescription *fieldDesc = field->description_;
1150 GPBMaybeClearOneofPrivate(self, oneof, fieldDesc->hasIndex, fieldDesc->number);
1153 NSCAssert(self->messageStorage_ != NULL,
1158 if (self->messageStorage_ == NULL) return;
1160 uint8_t *storage = (uint8_t *)self->messageStorage_;
1161 float *typePtr = (float *)&storage[fieldDesc->offset];
1166 || ((fieldDesc->flags & GPBFieldClearHasIvarOnZero) == 0));
1167 GPBSetHasIvar(self, fieldDesc->hasIndex, fieldDesc->number, hasValue);
1171 // clang-format on
1172 //%PDDM-EXPAND IVAR_POD_ACCESSORS_DEFN(Double, double)
1174 // clang-format off
1190 uint8_t *storage = (uint8_t *)self->messageStorage_;
1191 double *typePtr = (double *)&storage[field->description_->offset];
1220 GPBOneofDescriptor *oneof = field->containingOneof_;
1221 GPBMessageFieldDescription *fieldDesc = field->description_;
1223 GPBMaybeClearOneofPrivate(self, oneof, fieldDesc->hasIndex, fieldDesc->number);
1226 NSCAssert(self->messageStorage_ != NULL,
1231 if (self->messageStorage_ == NULL) return;
1233 uint8_t *storage = (uint8_t *)self->messageStorage_;
1234 double *typePtr = (double *)&storage[fieldDesc->offset];
1239 || ((fieldDesc->flags & GPBFieldClearHasIvarOnZero) == 0));
1240 GPBSetHasIvar(self, fieldDesc->hasIndex, fieldDesc->number, hasValue);
1244 // clang-format on
1245 //%PDDM-EXPAND-END (6 expansions)
1249 //%PDDM-EXPAND IVAR_ALIAS_DEFN_COPY_OBJECT(String, NSString)
1251 // clang-format off
1282 // clang-format on
1283 //%PDDM-EXPAND IVAR_ALIAS_DEFN_COPY_OBJECT(Bytes, NSData)
1285 // clang-format off
1316 // clang-format on
1317 //%PDDM-EXPAND IVAR_ALIAS_DEFN_OBJECT(Message, GPBMessage)
1319 // clang-format off
1350 // clang-format on
1351 //%PDDM-EXPAND IVAR_ALIAS_DEFN_OBJECT(Group, GPBMessage)
1353 // clang-format off
1384 // clang-format on
1385 //%PDDM-EXPAND-END (4 expansions)
1550 #pragma mark - Misc Dynamic Runtime Utils
1563 #pragma mark - Text Format Support
1653 #pragma clang diagnostic push
1654 #pragma clang diagnostic ignored "-Wswitch-enum"
1675 #pragma clang diagnostic pop
1697 #pragma clang diagnostic push
1698 #pragma clang diagnostic ignored "-Wswitch-enum"
1736 #pragma clang diagnostic pop
2002 NSArray *fieldsArray = descriptor->fields_;
2025 [toStr appendFormat:@"%@# --- Unknown fields ---\n", lineIndent];
2141 // a - if set, add an underscore
2142 // bb - 00 ccccc bytes as is
2143 // bb - 10 ccccc upper first, as is on rest, ccccc byte total
2144 // bb - 01 ccccc lower first, as is on rest, ccccc byte total
2145 // bb - 11 ccccc all upper, ccccc byte total
2156 --numEntries;
2209 --segmentLen;
2214 --segmentLen;
2251 GPBFieldDescriptor *firstField = oneof->fields_[0];
2252 NSCAssert(firstField->description_->hasIndex == oneofHasIndex,
2254 firstField->description_->hasIndex, oneofHasIndex);
2259 #pragma clang diagnostic pop