Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Dec 28, 2023

Changes

  1. Fixes the warning below (introduced after #3681):
rtextures.c: In function ‘LoadImageAnimFromMemory’:
rtextures.c:472:46: warning: pointer targets in passing argument 2 of ‘LoadImageFromMemory’ differ in signedness [-Wpointer-sign]
  472 |         image = LoadImageFromMemory(fileType,fileData,dataSize);
      |                                              ^~~~~~~~
      |                                              |
      |                                              const char *
In file included from rtextures.c:64:
raylib.h:1305:76: note: expected ‘const unsigned char *’ but argument is of type ‘const char *’
 1305 | RLAPI Image LoadImageFromMemory(const char *fileType, const unsigned char *fileData, int dataSize);      // Load image from memory buffer, fileType refers to extension: i.e. '.png'
      |                                                       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~
In file included from rtextures.c:216:
  1. Does that by changing const char *fileData to const unsigned char *fileData (R446).

  2. Adds LoadImageAnimFromMemory() to raylib.h (R1305) that was missing.

Edits:

  • 1. added line marks.
  • 2. added function to raylib.h.

pixels[i].b = (unsigned char)((imageCopy2[i].z)*255.0f);
pixels[i].a = (unsigned char)((alpha)*255.0f);
// printf("pixels[%d] = %d", i, pixels[i].r);
// printf("pixels[%d] = %d", i, pixels[i].r);

Check notice

Code scanning / CodeQL

Commented-out code

This comment appears to contain commented-out code.
@raysan5 raysan5 merged commit fd5e1e6 into raysan5:master Dec 28, 2023
@raysan5
Copy link
Owner

raysan5 commented Dec 28, 2023

@ubkp thanks for the review!

@ghost ghost deleted the fix/rtextures-warning branch December 28, 2023 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant