Fix variable get_img_width/height return value

Fix the functions to conform to the documentation: -1 means non-imaging
device, 0 means variable. Internally, -1 is used to represent variable
height (to be noticably different from the memset-imposed default of zero).
This commit is contained in:
Daniel Drake 2007-11-17 13:15:25 +00:00
parent ba24c0884a
commit fa24d51304

View file

@ -68,6 +68,9 @@ int fpi_imgdev_get_img_width(struct fp_img_dev *imgdev)
if (width > 0 && imgdrv->enlarge_factor > 1) if (width > 0 && imgdrv->enlarge_factor > 1)
width *= imgdrv->enlarge_factor; width *= imgdrv->enlarge_factor;
else if (width == -1)
width = 0;
return width; return width;
} }
@ -79,6 +82,9 @@ int fpi_imgdev_get_img_height(struct fp_img_dev *imgdev)
if (height > 0 && imgdrv->enlarge_factor > 1) if (height > 0 && imgdrv->enlarge_factor > 1)
height *= imgdrv->enlarge_factor; height *= imgdrv->enlarge_factor;
else if (height == -1)
height = 0;
return height; return height;
} }