Comment: | Fix shadowed variables and enable -Wshadow |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
00476e4430eb0d46ba4553fb01820e20 |
User & Date: | js on 2017-10-11 20:53:10 |
Other Links: | manifest | tags |
2017-10-12
| ||
23:50 | Xcode project: More closely match warnings check-in: 627d939ae3 user: js tags: trunk | |
2017-10-11
| ||
20:53 | Fix shadowed variables and enable -Wshadow check-in: 00476e4430 user: js tags: trunk | |
2017-10-07
| ||
15:19 | OFHTTPClient: Fix missing exception handling check-in: e3de40a9b9 user: js tags: trunk | |
Modified ObjFW.xcodeproj/project.pbxproj from [ec91098d79] to [3e0ddca419].
︙ | |||
3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 | 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 | + | ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = c11; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 2; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_PEDANTIC = YES; GCC_WARN_SHADOW = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-fexceptions", |
︙ | |||
3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 | 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 | + | ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = c11; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 2; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_RETURN_TYPE = YES; GCC_WARN_PEDANTIC = YES; GCC_WARN_SHADOW = YES; GCC_WARN_UNDECLARED_SELECTOR = YES; GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; OTHER_CFLAGS = ( "-fexceptions", "-fconstant-string-class=OFConstantString", |
︙ |
Modified configure.ac from [f20413e5a9] to [4d72ed7d39].
︙ | |||
173 174 175 176 177 178 179 180 181 182 183 184 185 186 | 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 | + + | AX_CHECK_COMPILER_FLAGS(-fno-common, [OBJCFLAGS="$OBJCFLAGS -fno-common"]) AX_CHECK_COMPILER_FLAGS(-fno-constant-cfstrings, [ OBJCFLAGS="$OBJCFLAGS -fno-constant-cfstrings" AC_SUBST(NO_CONST_CFSTRINGS, "-fno-constant-cfstrings") ]) AX_CHECK_COMPILER_FLAGS([-Wsign-compare -Werror], [OBJCFLAGS="$OBJCFLAGS -Wsign-compare"]) AX_CHECK_COMPILER_FLAGS([-Wshadow -Werror], [OBJCFLAGS="$OBJCFLAGS -Wshadow"]) AX_CHECK_COMPILER_FLAGS([-Wshorten-64-to-32 -Werror], [OBJCFLAGS="$OBJCFLAGS -Wshorten-64-to-32"]) AX_CHECK_COMPILER_FLAGS([-Wundeclared-selector -Werror], [OBJCFLAGS="$OBJCFLAGS -Wundeclared-selector"]) AX_CHECK_COMPILER_FLAGS([-Wsemicolon-before-method-body -Werror], [OBJCFLAGS="$OBJCFLAGS -Wsemicolon-before-method-body"]) AX_CHECK_COMPILER_FLAGS([-Wobjc-missing-property-synthesis -Werror], |
︙ |
Modified src/OFArray.m from [3fb8497b42] to [1c7667e82c].
︙ | |||
271 272 273 274 275 276 277 | 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 | - + - | - (id)objectAtIndexedSubscript: (size_t)index { return [self objectAtIndex: index]; } - (id)valueForKey: (OFString *)key { |
︙ | |||
728 729 730 731 732 733 734 | 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 | - - - + + + | for (id object in self) [object performSelector: selector]; } - (void)makeObjectsPerformSelector: (SEL)selector withObject: (id)object { |
︙ |
Modified src/OFINICategory.m from [e8548169a5] to [95cd2a6086].
︙ | |||
506 507 508 509 510 511 512 | 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 | - + - + | if ([line isKindOfClass: [OFINICategory_Comment class]]) { OFINICategory_Comment *comment = line; [stream writeFormat: @"%@\r\n", comment->_comment]; } else if ([line isKindOfClass: [OFINICategory_Pair class]]) { OFINICategory_Pair *pair = line; OFString *key = escapeString(pair->_key); OFString *value = escapeString(pair->_value); |
Modified src/OFMapTable.m from [73724a7b07] to [2c59c12f0d].
︙ | |||
205 206 207 208 209 210 211 | 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | - + - + | if (mapTable->_count != _count || mapTable->_keyFunctions.equal != _keyFunctions.equal || mapTable->_objectFunctions.equal != _objectFunctions.equal) return false; for (uint32_t i = 0; i < _capacity; i++) { if (_buckets[i] != NULL && _buckets[i] != &deleted) { |
︙ |
Modified src/OFSet.m from [876ac85821] to [9a3d14535d].
︙ | |||
209 210 211 212 213 214 215 | 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 | - + - | - (size_t)count { OF_UNRECOGNIZED_SELECTOR } - (id)valueForKey: (OFString *)key { |
︙ |
Modified src/OFString+XMLUnescaping.m from [d6e6b667b8] to [9667538219].
︙ | |||
125 126 127 128 129 130 131 | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | - + - + + - + - + - + + - + | length: 1]; else if (entityLength == 3 && memcmp(entity, "amp", 3) == 0) [ret appendCString: "&" encoding: OF_STRING_ENCODING_ASCII length: 1]; else if (entity[0] == '#') { |
︙ |
Modified src/OFURL.m from [114ec293ed] to [2082375f0b].
︙ | |||
132 133 134 135 136 137 138 | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 | - + - + - + | _user = [[OFString alloc] initWithUTF8String: UTF8String]; UTF8String = tmp2; } if ((tmp2 = strchr(UTF8String, ':')) != NULL) { |
︙ |
Modified tests/OFArrayTests.m from [4017a0a9f1] to [ce6bbc2cf5].
︙ | |||
350 351 352 353 354 355 356 | 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | - + - + - - + + - + - + - + - + - + - + - + - + - - + + | TEST(@"Detection of mutation during Fast Enumeration", ok) [m[0] removeLastObject]; #ifdef OF_HAVE_BLOCKS { |
︙ |
Modified tests/OFDictionaryTests.m from [76bc88ef2a] to [f2dd61fdb9].
︙ | |||
264 265 266 267 268 269 270 | 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 | - - + + - - - + + + - + - + - + - + - + - + - + - + - + + | TEST(@"-[stringByURLEncoding]", [[[OFDictionary dictionaryWithKeysAndObjects: @"foo", @"bar", @"q&x", @"q=x", nil] stringByURLEncoding] isEqual: @"q%26x=q%3Dx&foo=bar"]) #ifdef OF_HAVE_BLOCKS { |
︙ |
Modified tests/OFInvocationTests.m from [1bbbdf67b6] to [5d557debb9].
︙ | |||
316 317 318 319 320 321 322 | 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 | - - - + + + - - + + - + - - - + + + - + - + - + - - + + - + - - - + + + - + - + - + - - - - + + + + - + - + - + - + | [self methodSignatureForSelector: selector]]; [invocation setArgument: &self atIndex: 0]; [invocation setArgument: &selector atIndex: 1]; |
︙ | |||
475 476 477 478 479 480 481 | 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 | - + - + - - - + + + - + | [self methodSignatureForSelector: selector]]; [invocation setArgument: &self atIndex: 0]; [invocation setArgument: &selector atIndex: 1]; |
Modified tests/OFListTests.m from [3c7e2e133b] to [9cc03e5fa4].
︙ | |||
123 124 125 126 127 128 129 | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | - - + + - - + + | [list prependObject: strings[0]]; loe = [list firstListObject]; i = 0; ok = true; |
Modified utils/ofhttp/OFHTTP.m from [94fff99697] to [19987f61b8].
︙ | |||
759 760 761 762 763 764 765 | 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 | - - + + + - + | } else lengthString = OF_LOCALIZED(@"size_unknown", @"unknown"); if (_verbose) { void *pool = objc_autoreleasePoolPush(); OFDictionary OF_GENERIC(OFString *, OFString *) |
︙ |