MCPcopy Create free account
hub / github.com/demoth/jake2 / GetSpace

Method GetSpace

qcommon/src/main/java/jake2/qcommon/sizebuf_t.java:56–75  ·  view source on GitHub ↗

Ask for the pointer using sizebuf_t.cursize (RST)

(int length)

Source from the content-addressed store, hash-verified

54 * Ask for the pointer using sizebuf_t.cursize (RST)
55 */
56 private int GetSpace(int length) {
57 int oldsize;
58
59 if (cursize + length > maxsize) {
60 if (!allowoverflow)
61 Com.Error(Defines.ERR_FATAL, "SZ_GetSpace: overflow without allowoverflow set");
62
63 if (length > maxsize)
64 Com.Error(Defines.ERR_FATAL, "SZ_GetSpace: " + length + " is > full buffer size");
65
66 Com.Printf("SZ_GetSpace: overflow\n");
67 clear();
68 overflowed = true;
69 }
70
71 oldsize = cursize;
72 cursize += length;
73
74 return oldsize;
75 }
76
77 public void init(byte[] data, int length) {
78 // TODO check this. cwei

Callers 4

writeByteMethod · 0.95
writeShortMethod · 0.95
writeIntMethod · 0.95
writeBytesMethod · 0.95

Calls 3

ErrorMethod · 0.95
PrintfMethod · 0.95
clearMethod · 0.95

Tested by

no test coverage detected