Mercurial > hg
comparison mercurial/mpatch.c @ 10282:08a0f04b56bd
many, many trivial check-code fixups
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Mon, 25 Jan 2010 00:05:27 -0600 |
parents | bfad9865b1dc |
children | 2ac98313b26c |
comparison
equal
deleted
inserted
replaced
10281:e7d3b509af8b | 10282:08a0f04b56bd |
---|---|
33 #define PY_SSIZE_T_MAX INT_MAX | 33 #define PY_SSIZE_T_MAX INT_MAX |
34 #define PY_SSIZE_T_MIN INT_MIN | 34 #define PY_SSIZE_T_MIN INT_MIN |
35 #endif | 35 #endif |
36 | 36 |
37 #ifdef _WIN32 | 37 #ifdef _WIN32 |
38 # ifdef _MSC_VER | 38 #ifdef _MSC_VER |
39 /* msvc 6.0 has problems */ | 39 /* msvc 6.0 has problems */ |
40 # define inline __inline | 40 #define inline __inline |
41 typedef unsigned long uint32_t; | 41 typedef unsigned long uint32_t; |
42 # else | 42 #else |
43 # include <stdint.h> | 43 #include <stdint.h> |
44 # endif | 44 #endif |
45 static uint32_t ntohl(uint32_t x) | 45 static uint32_t ntohl(uint32_t x) |
46 { | 46 { |
47 return ((x & 0x000000ffUL) << 24) | | 47 return ((x & 0x000000ffUL) << 24) | |
48 ((x & 0x0000ff00UL) << 8) | | 48 ((x & 0x0000ff00UL) << 8) | |
49 ((x & 0x00ff0000UL) >> 8) | | 49 ((x & 0x00ff0000UL) >> 8) | |
50 ((x & 0xff000000UL) >> 24); | 50 ((x & 0xff000000UL) >> 24); |
51 } | 51 } |
52 #else | 52 #else |
53 /* not windows */ | 53 /* not windows */ |
54 # include <sys/types.h> | 54 #include <sys/types.h> |
55 # if defined __BEOS__ && !defined __HAIKU__ | 55 #if defined __BEOS__ && !defined __HAIKU__ |
56 # include <ByteOrder.h> | 56 #include <ByteOrder.h> |
57 # else | 57 #else |
58 # include <arpa/inet.h> | 58 #include <arpa/inet.h> |
59 # endif | 59 #endif |
60 # include <inttypes.h> | 60 #include <inttypes.h> |
61 #endif | 61 #endif |
62 | 62 |
63 static char mpatch_doc[] = "Efficient binary patching."; | 63 static char mpatch_doc[] = "Efficient binary patching."; |
64 static PyObject *mpatch_Error; | 64 static PyObject *mpatch_Error; |
65 | 65 |