From: David Griffith Date: Thu, 18 Jul 2019 01:06:45 +0000 (-0700) Subject: Endian swap not necessary. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=1edfac250dfc0bbb7fe72938006c0b8f3bfff72e;p=liskon_frotz.git Endian swap not necessary. --- diff --git a/src/blorb/blorb.h b/src/blorb/blorb.h index 6b10b04..bd53f14 100644 --- a/src/blorb/blorb.h +++ b/src/blorb/blorb.h @@ -146,10 +146,6 @@ typedef struct bb_zheader_struct { typedef struct bb_map_struct bb_map_t; -/* This can be handy elsewhere. */ -extern int bigendian; - - /* Function declarations. These functions are of fairly general use; they would apply to any Blorb file. */ diff --git a/src/blorb/blorblib.c b/src/blorb/blorblib.c index 972b7ce..7ed6296 100644 --- a/src/blorb/blorblib.c +++ b/src/blorb/blorblib.c @@ -16,8 +16,7 @@ static int lib_inited = FALSE; static bb_err_t bb_initialize_map(bb_map_t *map); static bb_err_t bb_initialize(void); static int sortsplot(const void *p1, const void *p2); - -int bigendian; +static int bigendian; static uint16 bb_native2(uint16 v) { diff --git a/src/curses/ux_pic.c b/src/curses/ux_pic.c index a82f9b2..399317d 100644 --- a/src/curses/ux_pic.c +++ b/src/curses/ux_pic.c @@ -71,23 +71,6 @@ static int round_div(int x, int y) } -extern int bigendian; - -static void swapbytes(void *object, size_t size) -{ - unsigned char *start, *end; - unsigned char swap; - - if(!bigendian) { - for (start = (unsigned char *)object, end = start + size - 1; start < end; ++start, --end ) { - swap = *start; - *start = *end; - *end = swap; - } - } -} - - bool unix_init_pictures (void) { int maxlegalpic = 0; @@ -151,10 +134,6 @@ bool unix_init_pictures (void) } /* JFIF */ } /* JPEG */ } - if (bigendian) { - swapbytes(&pict_info[i].orig_width, 4); - swapbytes(&pict_info[i].orig_height, 4); - } pict_info[i].height = round_div(pict_info[i].orig_height * h_screen_rows, y_scale); pict_info[i].width = round_div(pict_info[i].orig_width *