Skip to content

Commit 3d1d44d

Browse files
committed
Remove cruft
1 parent 3698269 commit 3d1d44d

1 file changed

Lines changed: 6 additions & 80 deletions

File tree

src/dmd/backend/outbuf.d

Lines changed: 6 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -212,64 +212,24 @@ struct Outbuffer
212212
write16n(v);
213213
}
214214

215-
/**
216-
* Writes a 32 bit int, no reserve check.
217-
*/
218-
@trusted
219-
private void write32n(int v)
220-
{
221-
*cast(int *)p = v;
222-
p += 4;
223-
}
224-
225215
/**
226216
* Writes a 32 bit int.
227217
*/
228-
void write32(int v)
218+
@trusted void write32(int v)
229219
{
230220
reserve(4);
231-
write32n(v);
232-
}
233-
234-
/**
235-
* Writes a 64 bit long, no reserve check
236-
*/
237-
@trusted
238-
private void write64n(long v)
239-
{
240-
*cast(long *)p = v;
241-
p += 8;
221+
*cast(int *)p = v;
222+
p += 4;
242223
}
243224

244225
/**
245226
* Writes a 64 bit long.
246227
*/
247-
void write64(long v)
228+
@trusted void write64(long v)
248229
{
249230
reserve(8);
250-
write64n(v);
251-
}
252-
253-
/**
254-
* Writes a 32 bit float.
255-
*/
256-
@trusted
257-
private void writeFloat(float v)
258-
{
259-
reserve(float.sizeof);
260-
*cast(float *)p = v;
261-
p += float.sizeof;
262-
}
263-
264-
/**
265-
* Writes a 64 bit double.
266-
*/
267-
@trusted
268-
private void writeDouble(double v)
269-
{
270-
reserve(double.sizeof);
271-
*cast(double *)p = v;
272-
p += double.sizeof;
231+
*cast(long *)p = v;
232+
p += 8;
273233
}
274234

275235
/**
@@ -303,40 +263,6 @@ struct Outbuffer
303263
writeString(cast(const(char)[])(s));
304264
}
305265

306-
/**
307-
* Inserts string at beginning of buffer.
308-
*/
309-
@trusted
310-
private void prependBytes(const(char)* s)
311-
{
312-
prepend(s, strlen(s));
313-
}
314-
315-
/**
316-
* Inserts bytes at beginning of buffer.
317-
*/
318-
@trusted
319-
private void prepend(const(void)* b, size_t len)
320-
{
321-
reserve(len);
322-
memmove(buf + len,buf,p - buf);
323-
memcpy(buf,b,len);
324-
p += len;
325-
}
326-
327-
/**
328-
* Bracket buffer contents with c1 and c2.
329-
*/
330-
@trusted
331-
private void bracket(char c1,char c2)
332-
{
333-
reserve(2);
334-
memmove(buf + 1,buf,p - buf);
335-
buf[0] = c1;
336-
p[1] = c2;
337-
p += 2;
338-
}
339-
340266
/**
341267
* Returns the number of bytes written.
342268
*/

0 commit comments

Comments
 (0)