Skip to content

Commit

Permalink
Removed extraneous ARUint8 argument from loadImage
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Grijalva committed May 23, 2014
1 parent 1f1bb48 commit 9ee1f85
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions AR_Simple/ImageLoader.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Uint32 getpixel(SDL_Surface *surface, int x, int y)
}
}

ARUint8* loadImage(char* filename, ARUint8* dataPtr, int* w, int* h)
ARUint8* loadImage(char* filename, int* w, int* h)
{
SDL_Surface* img = IMG_Load(filename);
if (!img)
Expand All @@ -44,7 +44,7 @@ ARUint8* loadImage(char* filename, ARUint8* dataPtr, int* w, int* h)
*w = img->w; // Assigned width and height to the given pointers
*h = img->h;

dataPtr = (ARUint8*)calloc(img->w * img->h * 4, sizeof(ARUint8)); // Allocate space for image data
ARUint8* dataPtr = (ARUint8*)calloc(img->w * img->h * 4, sizeof(ARUint8)); // Allocate space for image data

// Write image data to the dataPtr variable
for (int y = 0; y < img->h; y++)
Expand Down
2 changes: 1 addition & 1 deletion AR_Simple/ImageLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ Uint32 getpixel(SDL_Surface *surface, int x, int y);
w: Will be assigned the width of image
h: Will be assigned the height of the image
*/
ARUint8* loadImage(char* filename, ARUint8* dataPtr, int* w, int* h);
ARUint8* loadImage(char* filename, int* w, int* h);

#endif
2 changes: 1 addition & 1 deletion AR_Simple/Main.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ int main(int argc, char **argv)
createOutputFile(); // Delete any old output.csv file and create a fresh one
for (int i = 1; i < argc; i++) // For each input image
{
dataPtr = loadImage(argv[i], dataPtr, &img_width, &img_height);
dataPtr = loadImage(argv[i], &img_width, &img_height);
if (dataPtr == NULL)
{
printf("Failed to load image: '%s' It will be skipped...\n", argv[i]);
Expand Down

0 comments on commit 9ee1f85

Please sign in to comment.