summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/formats/imageutl.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/formats/imageutl.h')
-rw-r--r--src/lib/formats/imageutl.h64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/lib/formats/imageutl.h b/src/lib/formats/imageutl.h
index 1822b72a17a..49c1df55b39 100644
--- a/src/lib/formats/imageutl.h
+++ b/src/lib/formats/imageutl.h
@@ -73,14 +73,14 @@ INLINE void place_integer_be(void *ptr, size_t offset, size_t size, UINT64 value
break;
default:
- if (size >= 1) byte_ptr[0] = (UINT8) (value >> ((size - 1) * 8));
- if (size >= 2) byte_ptr[1] = (UINT8) (value >> ((size - 2) * 8));
- if (size >= 3) byte_ptr[2] = (UINT8) (value >> ((size - 3) * 8));
- if (size >= 4) byte_ptr[3] = (UINT8) (value >> ((size - 4) * 8));
- if (size >= 5) byte_ptr[4] = (UINT8) (value >> ((size - 5) * 8));
- if (size >= 6) byte_ptr[5] = (UINT8) (value >> ((size - 6) * 8));
- if (size >= 7) byte_ptr[6] = (UINT8) (value >> ((size - 7) * 8));
- if (size >= 8) byte_ptr[7] = (UINT8) (value >> ((size - 8) * 8));
+ if (size >= 1) byte_ptr[0] = (UINT8) (value >> ((size - 1) * 8));
+ if (size >= 2) byte_ptr[1] = (UINT8) (value >> ((size - 2) * 8));
+ if (size >= 3) byte_ptr[2] = (UINT8) (value >> ((size - 3) * 8));
+ if (size >= 4) byte_ptr[3] = (UINT8) (value >> ((size - 4) * 8));
+ if (size >= 5) byte_ptr[4] = (UINT8) (value >> ((size - 5) * 8));
+ if (size >= 6) byte_ptr[5] = (UINT8) (value >> ((size - 6) * 8));
+ if (size >= 7) byte_ptr[6] = (UINT8) (value >> ((size - 7) * 8));
+ if (size >= 8) byte_ptr[7] = (UINT8) (value >> ((size - 8) * 8));
break;
}
}
@@ -109,14 +109,14 @@ INLINE UINT64 pick_integer_be(const void *ptr, size_t offset, size_t size)
break;
default:
- if (size >= 1) result |= ((UINT64) byte_ptr[0]) << ((size - 1) * 8);
- if (size >= 2) result |= ((UINT64) byte_ptr[1]) << ((size - 2) * 8);
- if (size >= 3) result |= ((UINT64) byte_ptr[2]) << ((size - 3) * 8);
- if (size >= 4) result |= ((UINT64) byte_ptr[3]) << ((size - 4) * 8);
- if (size >= 5) result |= ((UINT64) byte_ptr[4]) << ((size - 5) * 8);
- if (size >= 6) result |= ((UINT64) byte_ptr[5]) << ((size - 6) * 8);
- if (size >= 7) result |= ((UINT64) byte_ptr[6]) << ((size - 7) * 8);
- if (size >= 8) result |= ((UINT64) byte_ptr[7]) << ((size - 8) * 8);
+ if (size >= 1) result |= ((UINT64) byte_ptr[0]) << ((size - 1) * 8);
+ if (size >= 2) result |= ((UINT64) byte_ptr[1]) << ((size - 2) * 8);
+ if (size >= 3) result |= ((UINT64) byte_ptr[2]) << ((size - 3) * 8);
+ if (size >= 4) result |= ((UINT64) byte_ptr[3]) << ((size - 4) * 8);
+ if (size >= 5) result |= ((UINT64) byte_ptr[4]) << ((size - 5) * 8);
+ if (size >= 6) result |= ((UINT64) byte_ptr[5]) << ((size - 6) * 8);
+ if (size >= 7) result |= ((UINT64) byte_ptr[6]) << ((size - 7) * 8);
+ if (size >= 8) result |= ((UINT64) byte_ptr[7]) << ((size - 8) * 8);
break;
}
return result;
@@ -141,14 +141,14 @@ INLINE void place_integer_le(void *ptr, size_t offset, size_t size, UINT64 value
break;
default:
- if (size >= 1) byte_ptr[0] = (UINT8) (value >> (0 * 8));
- if (size >= 2) byte_ptr[1] = (UINT8) (value >> (1 * 8));
- if (size >= 3) byte_ptr[2] = (UINT8) (value >> (2 * 8));
- if (size >= 4) byte_ptr[3] = (UINT8) (value >> (3 * 8));
- if (size >= 5) byte_ptr[4] = (UINT8) (value >> (4 * 8));
- if (size >= 6) byte_ptr[5] = (UINT8) (value >> (5 * 8));
- if (size >= 7) byte_ptr[6] = (UINT8) (value >> (6 * 8));
- if (size >= 8) byte_ptr[7] = (UINT8) (value >> (7 * 8));
+ if (size >= 1) byte_ptr[0] = (UINT8) (value >> (0 * 8));
+ if (size >= 2) byte_ptr[1] = (UINT8) (value >> (1 * 8));
+ if (size >= 3) byte_ptr[2] = (UINT8) (value >> (2 * 8));
+ if (size >= 4) byte_ptr[3] = (UINT8) (value >> (3 * 8));
+ if (size >= 5) byte_ptr[4] = (UINT8) (value >> (4 * 8));
+ if (size >= 6) byte_ptr[5] = (UINT8) (value >> (5 * 8));
+ if (size >= 7) byte_ptr[6] = (UINT8) (value >> (6 * 8));
+ if (size >= 8) byte_ptr[7] = (UINT8) (value >> (7 * 8));
break;
}
}
@@ -177,14 +177,14 @@ INLINE UINT64 pick_integer_le(const void *ptr, size_t offset, size_t size)
break;
default:
- if (size >= 1) result |= ((UINT64) byte_ptr[0]) << (0 * 8);
- if (size >= 2) result |= ((UINT64) byte_ptr[1]) << (1 * 8);
- if (size >= 3) result |= ((UINT64) byte_ptr[2]) << (2 * 8);
- if (size >= 4) result |= ((UINT64) byte_ptr[3]) << (3 * 8);
- if (size >= 5) result |= ((UINT64) byte_ptr[4]) << (4 * 8);
- if (size >= 6) result |= ((UINT64) byte_ptr[5]) << (5 * 8);
- if (size >= 7) result |= ((UINT64) byte_ptr[6]) << (6 * 8);
- if (size >= 8) result |= ((UINT64) byte_ptr[7]) << (7 * 8);
+ if (size >= 1) result |= ((UINT64) byte_ptr[0]) << (0 * 8);
+ if (size >= 2) result |= ((UINT64) byte_ptr[1]) << (1 * 8);
+ if (size >= 3) result |= ((UINT64) byte_ptr[2]) << (2 * 8);
+ if (size >= 4) result |= ((UINT64) byte_ptr[3]) << (3 * 8);
+ if (size >= 5) result |= ((UINT64) byte_ptr[4]) << (4 * 8);
+ if (size >= 6) result |= ((UINT64) byte_ptr[5]) << (5 * 8);
+ if (size >= 7) result |= ((UINT64) byte_ptr[6]) << (6 * 8);
+ if (size >= 8) result |= ((UINT64) byte_ptr[7]) << (7 * 8);
break;
}
return result;