Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/image/format/oslLoadImageFilePNG.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ void oslPngFlushFn(png_structp png_ptr) {
// No operation
}

OSL_IMAGE *oslLoadImageFilePNG(char *filename, int location, int pixelFormat) {
OSL_IMAGE *oslLoadImageFilePNG(char *filename, int location, int volatile pixelFormat) {
const size_t nSigSize = 8;
u8 signature[nSigSize];
OSL_IMAGE *img = NULL;
OSL_IMAGE * volatile img = NULL;
VIRTUAL_FILE *f;
// We only keep the location bits
int imgLocation = location & OSL_LOCATION_MASK;
Expand Down
6 changes: 3 additions & 3 deletions src/image/format/oslWriteImageFilePNG.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ void oslPngWriteFn(png_structp png_ptr, png_bytep data, png_size_t length) {
int oslWriteImageFilePNG(OSL_IMAGE *img, const char* filename, int flags) {
png_structp png_ptr = NULL;
png_infop info_ptr = NULL;
VIRTUAL_FILE *f = NULL;
u8* line = NULL;
VIRTUAL_FILE * volatile f = NULL;
u8* volatile line = NULL;
int width = img->offsetX1 - img->offsetX0;
int height = img->offsetY1 - img->offsetY0;
int r, g, b, a;
int lbSuccess = 0;
int volatile lbSuccess = 0;
const int saveAlpha = flags & OSL_WRI_ALPHA;

// Open the file for writing
Expand Down
4 changes: 2 additions & 2 deletions src/sfont.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ typedef struct
// Load a PNG image (OSLib cannot handle images bigger than 512x512)
static PNG_DATA* _loadFromPNG(const char *filename) {
// Allocate memory for PNG_DATA structure
PNG_DATA *pngData = (PNG_DATA*)malloc(sizeof(PNG_DATA));
PNG_DATA * volatile pngData = (PNG_DATA*)malloc(sizeof(PNG_DATA));
if (!pngData)
return NULL;

Expand Down Expand Up @@ -279,7 +279,7 @@ OSL_SFONT *oslLoadSFontFile(char *filename, int pixelFormat) {
oslLockImage(lt->letter);

// Copy the image data into the letter
for (int dx = pos; dx < pos + lt->width; ++dx) {
for (unsigned int dx = pos; dx < pos + lt->width; ++dx) {
for (int dy = 1; dy < img->sizeY; ++dy) {
int pixel = _getPixel(img, dx, dy);
pixel = oslConvertColorEx(lt->letter->palette, lt->letter->pixelFormat, OSL_PF_8888, pixel);
Expand Down