bhyve-fw: drop CSM
[oi-userland.git] / components / library / FreeImage / patches / PSDParser.cpp.patch
blob8a08b26b032fe13fb17fe810f896d9e3e362b375
1 --- FreeImage/Source/FreeImage/PSDParser.cpp Thu Feb 11 04:18:02 2016
2 +++ FreeImage/Source/FreeImage/PSDParser_.cpp Tue May 24 10:55:22 2022
3 @@ -133,8 +133,8 @@
4 template <>
5 class PSDGetValue<8> {
6 public:
7 - static inline UINT64 get(const BYTE * iprBuffer) {
8 - UINT64 v = ((const UINT64*)iprBuffer)[0];
9 + static inline uint64_t get(const BYTE * iprBuffer) {
10 + uint64_t v = ((const uint64_t*)iprBuffer)[0];
11 #ifndef FREEIMAGE_BIGENDIAN
12 SwapInt64(&v);
13 #endif
14 @@ -147,7 +147,7 @@
16 // --------------------------------------------------------------------------
18 -static UINT64
19 +static uint64_t
20 psdReadSize(FreeImageIO *io, fi_handle handle, const psdHeaderInfo& header) {
21 if(header._Version == 1) {
22 BYTE Length[4];
23 @@ -199,11 +199,11 @@
24 template <>
25 class PSDSetValue<8> {
26 public:
27 - static inline void set(const BYTE * iprBuffer, UINT64 v) {
28 + static inline void set(const BYTE * iprBuffer, uint64_t v) {
29 #ifndef FREEIMAGE_BIGENDIAN
30 SwapInt64(&v);
31 #endif
32 - ((UINT64*)iprBuffer)[0] = v;
33 + ((uint64_t*)iprBuffer)[0] = v;
37 @@ -213,7 +213,7 @@
38 // --------------------------------------------------------------------------
40 static inline bool
41 -psdWriteSize(FreeImageIO *io, fi_handle handle, const psdHeaderInfo& header, UINT64 v) {
42 +psdWriteSize(FreeImageIO *io, fi_handle handle, const psdHeaderInfo& header, uint64_t v) {
43 if(header._Version == 1) {
44 BYTE Length[4];
45 psdSetLongValue(Length, sizeof(Length), (DWORD)v);
46 @@ -1063,10 +1063,10 @@
47 bool psdParser::ReadLayerAndMaskInfoSection(FreeImageIO *io, fi_handle handle) {
48 bool bSuccess = true;
50 - UINT64 nTotalBytes = psdReadSize(io, handle, _headerInfo);
51 + uint64_t nTotalBytes = psdReadSize(io, handle, _headerInfo);
53 // Hack to handle large PSB files without using fseeko().
54 - if (sizeof(long) < sizeof(UINT64)) {
55 + if (sizeof(long) < sizeof(uint64_t)) {
56 const long offset = 0x10000000;
57 while (nTotalBytes > offset) {
58 if (io->seek_proc(handle, offset, SEEK_CUR) != 0) {
59 @@ -1672,7 +1672,7 @@
60 // Short section with no layers.
61 BYTE IntValue[4];
63 - UINT64 size;
64 + uint64_t size;
65 if(_headerInfo._Version == 1) {
66 size = 8;
67 } else {