Endian swap not necessary.
authorDavid Griffith <dave@661.org>
Thu, 18 Jul 2019 01:06:45 +0000 (18:06 -0700)
committerDavid Griffith <dave@661.org>
Thu, 18 Jul 2019 01:06:45 +0000 (18:06 -0700)
src/blorb/blorb.h
src/blorb/blorblib.c
src/curses/ux_pic.c

index 6b10b0497f4e19d57a7d5ea3392c1f0f111ecabf..bd53f143e78c636ed3a1afcb2690bfb0348da668 100644 (file)
@@ -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. */
 
index 972b7ce26b47868afd842ae590059b0753139c7c..7ed6296a9c81ce651648e60dcb42e9945642c2cc 100644 (file)
@@ -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)
 {
index a82f9b25060756e1872810304da3a99fd8ef116b..399317d3d03065f0615244a951110c92001ff2a6 100644 (file)
@@ -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 *