aboutsummaryrefslogblamecommitdiffstats
path: root/rtgrpblib_reset_raster.c
blob: 2cfef42a42de44fe19186c4c78d5d1cfb1f6bf54 (plain) (tree)




























                                                                                   
/* See LICENSE file for copyright and license details. */
#include "common.h"
#ifndef TEST


int
rtgrpblib_reset_raster(RASTER *raster, size_t width, size_t height)
{
	if (!width || !height || width > raster->width * raster->height / height) {
		errno = EINVAL;
		return -1;
	}

	raster->width = width;
	raster->height = height;
	memset(raster->cells, 0, width * height * sizeof(*raster->cells));
	return 0;
}


#else

int
main(void)
{
	return 0; /* TODO add test */
}

#endif