ObjFW  Check-in [32f7b1390a]

Overview
Comment:Remove +[OFArray arrayWithCArray:] as it is pretty useless.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 32f7b1390aee3d01f683b78437e0b2e3924229a01c3a94c67431b2b338f99307
User & Date: js on 2012-03-12 11:01:07
Other Links: manifest | tags
Context
2012-03-12
11:54
OFArray: +[arrayWithCArray:length:] -> +[arrayWithObjects:count:]. check-in: 008be86a16 user: js tags: trunk
11:01
Remove +[OFArray arrayWithCArray:] as it is pretty useless. check-in: 32f7b1390a user: js tags: trunk
2012-03-08
23:20
Add +[OFFile sizeOfFile:]. check-in: 6bcf417920 user: js tags: trunk
Changes

Modified src/OFArray.h from [f3beab2ab4] to [d765ca91e7].

75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
 * \brief Creates a new OFArray with the objects from the specified array.
 *
 * \param array An array
 * \return A new autoreleased OFArray
 */
+ arrayWithArray: (OFArray*)array;

/**
 * \brief Creates a new OFArray with the objects from the specified C array.
 *
 * \param objects A C array of objects, terminated with nil
 * \return A new autoreleased OFArray
 */
+ arrayWithCArray: (id*)objects;

/**
 * \brief Creates a new OFArray with the objects from the specified C array of
 *	  the specified length.
 *
 * \param objects A C array of objects
 * \param length The length of the C array
 * \return A new autoreleased OFArray







<
<
<
<
<
<
<
<







75
76
77
78
79
80
81








82
83
84
85
86
87
88
 * \brief Creates a new OFArray with the objects from the specified array.
 *
 * \param array An array
 * \return A new autoreleased OFArray
 */
+ arrayWithArray: (OFArray*)array;









/**
 * \brief Creates a new OFArray with the objects from the specified C array of
 *	  the specified length.
 *
 * \param objects A C array of objects
 * \param length The length of the C array
 * \return A new autoreleased OFArray
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
 * \brief Initializes an OFArray with the objects from the specified array.
 *
 * \param array An array
 * \return An initialized OFArray
 */
- initWithArray: (OFArray*)array;

/**
 * \brief Initializes an OFArray with the objects from the specified C array.
 *
 * \param objects A C array of objects, terminated with nil
 * \return An initialized OFArray
 */
- initWithCArray: (id*)objects;

/**
 * \brief Initializes an OFArray with the objects from the specified C array of
 *	  the specified length.
 *
 * \param objects A C array of objects
 * \param length The length of the C array
 * \return An initialized OFArray







<
<
<
<
<
<
<
<







120
121
122
123
124
125
126








127
128
129
130
131
132
133
 * \brief Initializes an OFArray with the objects from the specified array.
 *
 * \param array An array
 * \return An initialized OFArray
 */
- initWithArray: (OFArray*)array;









/**
 * \brief Initializes an OFArray with the objects from the specified C array of
 *	  the specified length.
 *
 * \param objects A C array of objects
 * \param length The length of the C array
 * \return An initialized OFArray

Modified src/OFArray.m from [6919605399] to [8fffeb8088].

71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
}

- initWithArray: (OFArray*)array
{
	return (id)[[OFArray_adjacent alloc] initWithArray: array];
}

- initWithCArray: (id*)objects
{
	return (id)[[OFArray_adjacent alloc] initWithCArray: objects];
}

- initWithCArray: (id*)objects
	  length: (size_t)length
{
	return (id)[[OFArray_adjacent alloc] initWithCArray: objects
						     length: length];
}








<
<
<
<
<







71
72
73
74
75
76
77





78
79
80
81
82
83
84
}

- initWithArray: (OFArray*)array
{
	return (id)[[OFArray_adjacent alloc] initWithArray: array];
}






- initWithCArray: (id*)objects
	  length: (size_t)length
{
	return (id)[[OFArray_adjacent alloc] initWithCArray: objects
						     length: length];
}

153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
}

+ arrayWithArray: (OFArray*)array
{
	return [[[self alloc] initWithArray: array] autorelease];
}

+ arrayWithCArray: (id*)objects
{
	return [[[self alloc] initWithCArray: objects] autorelease];
}

+ arrayWithCArray: (id*)objects
	   length: (size_t)length
{
	return [[[self alloc] initWithCArray: objects
				      length: length] autorelease];
}








<
<
<
<
<







148
149
150
151
152
153
154





155
156
157
158
159
160
161
}

+ arrayWithArray: (OFArray*)array
{
	return [[[self alloc] initWithArray: array] autorelease];
}






+ arrayWithCArray: (id*)objects
	   length: (size_t)length
{
	return [[[self alloc] initWithCArray: objects
				      length: length] autorelease];
}

206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
	[self release];
	@throw [OFNotImplementedException exceptionWithClass: c
						    selector: _cmd];
}

- initWithArray: (OFArray*)array
{
	Class c = isa;
	[self release];
	@throw [OFNotImplementedException exceptionWithClass: c
						    selector: _cmd];
}

- initWithCArray: (id*)objects
{
	Class c = isa;
	[self release];
	@throw [OFNotImplementedException exceptionWithClass: c
						    selector: _cmd];
}

- initWithCArray: (id*)objects







<
<
<
<
<
<
<
<







196
197
198
199
200
201
202








203
204
205
206
207
208
209
	[self release];
	@throw [OFNotImplementedException exceptionWithClass: c
						    selector: _cmd];
}

- initWithArray: (OFArray*)array
{








	Class c = isa;
	[self release];
	@throw [OFNotImplementedException exceptionWithClass: c
						    selector: _cmd];
}

- initWithCArray: (id*)objects

Modified src/OFArray_adjacent.m from [49ed7295ca] to [650b5ba321].

110
111
112
113
114
115
116
117
118
119
120
121
122
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
		for (i = 0; i < count; i++)
			[cArray[i] release];

		/* Prevent double-release of objects */
		[array release];
		array = nil;

		[self release];
		@throw e;
	}

	return self;
}

- initWithCArray: (id*)objects
{
	self = [self init];

	@try {
		id *object;
		size_t count = 0;

		for (object = objects; *object != nil; object++) {
			[*object retain];
			count++;
		}

		[array addNItems: count
		      fromCArray: objects];
	} @catch (id e) {
		id *object;

		for (object = objects; *object != nil; object++)
			[*object release];

		[self release];
		@throw e;
	}

	return self;
}








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







110
111
112
113
114
115
116




























117
118
119
120
121
122
123
		for (i = 0; i < count; i++)
			[cArray[i] release];

		/* Prevent double-release of objects */
		[array release];
		array = nil;





























		[self release];
		@throw e;
	}

	return self;
}

Modified src/OFMutableArray.m from [46ae62e754] to [5ab0a3a71f].

104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
}

- initWithArray: (OFArray*)array
{
	return (id)[[OFMutableArray_adjacent alloc] initWithArray: array];
}

- initWithCArray: (id*)objects
{
	return (id)[[OFMutableArray_adjacent alloc] initWithCArray: objects];
}

- initWithCArray: (id*)objects
	  length: (size_t)length
{
	return (id)[[OFMutableArray_adjacent alloc] initWithCArray: objects
							    length: length];
}








<
<
<
<
<







104
105
106
107
108
109
110





111
112
113
114
115
116
117
}

- initWithArray: (OFArray*)array
{
	return (id)[[OFMutableArray_adjacent alloc] initWithArray: array];
}






- initWithCArray: (id*)objects
	  length: (size_t)length
{
	return (id)[[OFMutableArray_adjacent alloc] initWithCArray: objects
							    length: length];
}