MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / ucvector_resize

Function ucvector_resize

src/lodepng.cpp:207–223  ·  view source on GitHub ↗

returns 1 if success, 0 if failure ==> nothing done*/

Source from the content-addressed store, hash-verified

205
206/*returns 1 if success, 0 if failure ==> nothing done*/
207static unsigned ucvector_resize(ucvector* p, size_t size)
208{
209 if(size * sizeof(unsigned char) > p->allocsize)
210 {
211 size_t newsize = size * sizeof(unsigned char) * 2;
212 void* data = lodepng_realloc(p->data, newsize);
213 if(data)
214 {
215 p->allocsize = newsize;
216 p->data = (unsigned char*)data;
217 p->size = size;
218 }
219 else return 0; /*error: not enough memory*/
220 }
221 else p->size = size;
222 return 1;
223}
224
225#ifdef LODEPNG_COMPILE_PNG
226

Callers 10

ucvector_resizevFunction · 0.85
ucvector_push_backFunction · 0.85
lodepng_add32bitIntFunction · 0.85
inflateHuffmanBlockFunction · 0.85
inflateNoCompressionFunction · 0.85
lodepng_inflatevFunction · 0.85
readChunk_iTXtFunction · 0.85
decodeGenericFunction · 0.85
lodepng.cppFile · 0.85
filterFunction · 0.85

Calls 1

lodepng_reallocFunction · 0.85

Tested by

no test coverage detected