Skip to content

Commit

Permalink
Initializing all members of PCX header to 0. Eliminated
Browse files Browse the repository at this point in the history
useless 'typedef struct'.
  • Loading branch information
marzojr committed Nov 25, 2016
1 parent 936f695 commit b335492
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/shp2pcx.cc
Expand Up @@ -56,7 +56,7 @@ using std::strlen;
using std::memset;
using std::memcpy;

typedef struct PCX_Header {
struct PCX_Header {
uint8 manufacturer;
uint8 version;
uint8 compression;
Expand All @@ -71,7 +71,7 @@ typedef struct PCX_Header {
sint16 bytesperline;
sint16 color;
uint8 filler[58];
} PCX_Header;
};

struct u7frame {
sint16 leftX;
Expand Down Expand Up @@ -376,6 +376,7 @@ void save_image(uint8 *pixels, uint8 *palette, int width, int height, char *file
return;
}

memset(static_cast<void *>(&header), 0, sizeof(PCX_Header));
pitch = width;

header.manufacturer = 0x0a;
Expand Down

0 comments on commit b335492

Please sign in to comment.