ObjFW  Check-in [6143baaaee]

Overview
Comment:Get rid of a new Clang warning.

Clang now warns if the enumeration variable of a fast enumeration is not
used.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6143baaaee675b46c97f6535fff5b8c6554847cb8a043c1128f2b195dcb15a9f
User & Date: js on 2013-07-10 12:33:37
Other Links: manifest | tags
Context
2013-07-11
01:36
PLATFORMS.md: Add Wii and PSP. check-in: 4d5fd9f914 user: js tags: trunk
2013-07-10
12:33
Get rid of a new Clang warning. check-in: 6143baaaee user: js tags: trunk
2013-07-09
22:17
OFFile: Rename +[createSymbolicLinkAtPath:…]. check-in: 8e48f0d6a4 user: js tags: trunk
Changes

Modified tests/OFArrayTests.m from [4b9f82311d] to [c4b233b4a6].

221
222
223
224
225
226
227


228
229

230
231
232
233
234
235
236
	[m[0] replaceObjectAtIndex: 2
			withObject: c_ary[2]];

	ok = false;
	i = 0;
	@try {
		for (OFString *s in m[0]) {


			if (i == 0)
				[m[0] addObject: @""];

			i++;
		}
	} @catch (OFEnumerationMutationException *e) {
		ok = true;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok)







>
>


>







221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
	[m[0] replaceObjectAtIndex: 2
			withObject: c_ary[2]];

	ok = false;
	i = 0;
	@try {
		for (OFString *s in m[0]) {
			(void)s;

			if (i == 0)
				[m[0] addObject: @""];

			i++;
		}
	} @catch (OFEnumerationMutationException *e) {
		ok = true;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok)

Modified tests/OFDictionaryTests.m from [d16af2dca7] to [45630b47b6].

109
110
111
112
113
114
115
116


117
118

119
120
121
122
123
124
125
		i++;
	}

	TEST(@"Fast Enumeration", ok)

	ok = false;
	@try {
		for (OFString *key in dict)


			[dict setObject: @""
				 forKey: @""];

	} @catch (OFEnumerationMutationException *e) {
		ok = true;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok)

	[dict removeObjectForKey: @""];







|
>
>


>







109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
		i++;
	}

	TEST(@"Fast Enumeration", ok)

	ok = false;
	@try {
		for (OFString *key in dict) {
			(void)key;

			[dict setObject: @""
				 forKey: @""];
		}
	} @catch (OFEnumerationMutationException *e) {
		ok = true;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok)

	[dict removeObjectForKey: @""];

Modified tests/OFListTests.m from [a1285e945c] to [6fc9d88b76].

139
140
141
142
143
144
145
146


147

148
149
150
151
152
153
154
155
156
157
	if ([list count] != i)
		ok = false;

	TEST(@"Fast Enumeration", ok)

	ok = false;
	@try {
		for (OFString *obj in list)


			[list removeListObject: [list lastListObject]];

	} @catch (OFEnumerationMutationException *e) {
		ok = true;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok)
#endif

	[pool drain];
}
@end







|
>
>

>










139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
	if ([list count] != i)
		ok = false;

	TEST(@"Fast Enumeration", ok)

	ok = false;
	@try {
		for (OFString *obj in list) {
			(void)obj;

			[list removeListObject: [list lastListObject]];
		}
	} @catch (OFEnumerationMutationException *e) {
		ok = true;
	}

	TEST(@"Detection of mutation during Fast Enumeration", ok)
#endif

	[pool drain];
}
@end