Skip to content

Commit

Permalink
now takes a as parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
wernsey committed Apr 21, 2021
1 parent 905834c commit 844e2a7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions bmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3706,7 +3706,7 @@ Bitmap *bm_from_Xbm(int w, int h, unsigned char *data) {
/*
See also https://www.fileformat.info/format/xpm/egff.htm
*/
Bitmap *bm_from_Xpm(char *xpm[]) {
Bitmap *bm_from_Xpm(const char *xpm[]) {
#define XPM_MAX_COLORS 256
Bitmap *b;
int w, h, nc, cp;
Expand Down Expand Up @@ -3777,7 +3777,7 @@ Bitmap *bm_from_Xpm(char *xpm[]) {

/* Get the actual pixel data */
for(j = 0; j < h; j++) {
char *row = xpm[1 + nc + j];
const char *row = xpm[1 + nc + j];
for(i = 0; i < w; i++) {
assert(row[i]);
for(r = 0; r < nc; r++) {
Expand Down
4 changes: 2 additions & 2 deletions bmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,12 @@ Bitmap *bm_crop(Bitmap *b, int x, int y, int w, int h);
Bitmap *bm_from_Xbm(int w, int h, unsigned char *data);

/**
* #### `Bitmap *bm_from_Xpm(char *xpm[])`
* #### `Bitmap *bm_from_Xpm(const char *xpm[])`
*
* Creates a `Bitmap` object from [X PixMap](https://en.wikipedia.org/wiki/X_PixMap)
* data in a source file.
*/
Bitmap *bm_from_Xpm(char *xpm[]);
Bitmap *bm_from_Xpm(const char *xpm[]);

/**
* #### `int bm_width(Bitmap *b)`
Expand Down

0 comments on commit 844e2a7

Please sign in to comment.