File: 01-amd64_fixes.patch

package info (click to toggle)
catdoc 1%3A0.95-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,456 kB
  • sloc: ansic: 3,920; sh: 327; tcl: 262; makefile: 188
file content (29 lines) | stat: -rw-r--r-- 1,340 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Description: amd64_fixes.patch
Author: Nick Bane <nick@enomem.co.uk>

--- a/src/numutils.c
+++ b/src/numutils.c
@@ -12,18 +12,18 @@
  * way
  *********************************************************************/ 
 uint16_t getshort(unsigned char *buffer,int offset) {
-	return (unsigned short int)buffer[offset]|((unsigned short int)buffer[offset+1]<<8);
+	return (uint16_t)buffer[offset]|((uint16_t)buffer[offset+1]<<8);
 }  
 /********************************************************************/
 /* Reads 4-byte LSB  int from buffer at given offset almost platfom-indepent
  * way
  *********************************************************************/ 
 int32_t getlong(unsigned char *buffer,int offset) {
-	return (long)buffer[offset]|((long)buffer[offset+1]<<8L)
-		|((long)buffer[offset+2]<<16L)|((long)buffer[offset+3]<<24L);
+	return (int32_t)buffer[offset]|((int32_t)buffer[offset+1]<<8L)
+		|((int32_t)buffer[offset+2]<<16L)|((int32_t)buffer[offset+3]<<24L);
 }  
 
 uint32_t getulong(unsigned char *buffer,int offset) {
-	return (unsigned long)buffer[offset]|((unsigned long)buffer[offset+1]<<8L)
-		|((unsigned long)buffer[offset+2]<<16L)|((unsigned long)buffer[offset+3]<<24L);
+	return (uint32_t)buffer[offset]|((uint32_t)buffer[offset+1]<<8L)
+		|((uint32_t)buffer[offset+2]<<16L)|((uint32_t)buffer[offset+3]<<24L);
 }