diff options
| author | 2010-03-24 14:56:02 +0100 | |
|---|---|---|
| committer | 2010-03-24 14:56:02 +0100 | |
| commit | 6f07a0bb701d6236dda7b19bd04df6414708dc78 (patch) | |
| tree | 5fe616a32f5d6f658107d2302f9681fa55c961a1 | |
| parent | c39f08af9aca0f8b86c713345e2055e408b560dd (diff) | |
| download | libimobiledevice-6f07a0bb701d6236dda7b19bd04df6414708dc78.tar.gz libimobiledevice-6f07a0bb701d6236dda7b19bd04df6414708dc78.tar.bz2 | |
Use glib GUINT32_TO/FROM_BE macros instead of htonl/ntohl
| -rw-r--r-- | configure.ac | 2 | ||||
| -rw-r--r-- | src/property_list_service.c | 6 | ||||
| -rw-r--r-- | tools/idevicesyslog.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac index aaad326..6ead879 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -41,7 +41,7 @@ AC_CHECK_LIB(gcrypt, gcry_control, [AC_SUBST(libgcrypt_LIBS,[-lgcrypt])], ["libg | |||
| 41 | 41 | ||
| 42 | # Checks for header files. | 42 | # Checks for header files. |
| 43 | AC_HEADER_STDC | 43 | AC_HEADER_STDC |
| 44 | AC_CHECK_HEADERS([netinet/in.h stdint.h stdlib.h string.h gcrypt.h]) | 44 | AC_CHECK_HEADERS([stdint.h stdlib.h string.h gcrypt.h]) |
| 45 | 45 | ||
| 46 | # Checks for typedefs, structures, and compiler characteristics. | 46 | # Checks for typedefs, structures, and compiler characteristics. |
| 47 | AC_C_CONST | 47 | AC_C_CONST |
diff --git a/src/property_list_service.c b/src/property_list_service.c index eaf0b30..80b5f52 100644 --- a/src/property_list_service.c +++ b/src/property_list_service.c | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | */ | 20 | */ |
| 21 | #include <stdlib.h> | 21 | #include <stdlib.h> |
| 22 | #include <string.h> | 22 | #include <string.h> |
| 23 | #include <netinet/in.h> | 23 | #include <glib.h> |
| 24 | 24 | ||
| 25 | #include "property_list_service.h" | 25 | #include "property_list_service.h" |
| 26 | #include "idevice.h" | 26 | #include "idevice.h" |
| @@ -138,7 +138,7 @@ static property_list_service_error_t internal_plist_send(property_list_service_c | |||
| 138 | return PROPERTY_LIST_SERVICE_E_PLIST_ERROR; | 138 | return PROPERTY_LIST_SERVICE_E_PLIST_ERROR; |
| 139 | } | 139 | } |
| 140 | 140 | ||
| 141 | nlen = htonl(length); | 141 | nlen = GUINT32_TO_BE(length); |
| 142 | debug_info("sending %d bytes", length); | 142 | debug_info("sending %d bytes", length); |
| 143 | idevice_connection_send(client->connection, (const char*)&nlen, sizeof(nlen), (uint32_t*)&bytes); | 143 | idevice_connection_send(client->connection, (const char*)&nlen, sizeof(nlen), (uint32_t*)&bytes); |
| 144 | if (bytes == sizeof(nlen)) { | 144 | if (bytes == sizeof(nlen)) { |
| @@ -229,7 +229,7 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis | |||
| 229 | if ((char)pktlen == 0) { /* prevent huge buffers */ | 229 | if ((char)pktlen == 0) { /* prevent huge buffers */ |
| 230 | uint32_t curlen = 0; | 230 | uint32_t curlen = 0; |
| 231 | char *content = NULL; | 231 | char *content = NULL; |
| 232 | pktlen = ntohl(pktlen); | 232 | pktlen = GUINT32_FROM_BE(pktlen); |
| 233 | debug_info("%d bytes following", pktlen); | 233 | debug_info("%d bytes following", pktlen); |
| 234 | content = (char*)malloc(pktlen); | 234 | content = (char*)malloc(pktlen); |
| 235 | 235 | ||
diff --git a/tools/idevicesyslog.c b/tools/idevicesyslog.c index 32b9711..dcd8df6 100644 --- a/tools/idevicesyslog.c +++ b/tools/idevicesyslog.c | |||
| @@ -22,9 +22,9 @@ | |||
| 22 | #include <stdio.h> | 22 | #include <stdio.h> |
| 23 | #include <string.h> | 23 | #include <string.h> |
| 24 | #include <errno.h> | 24 | #include <errno.h> |
| 25 | #include <netinet/in.h> | ||
| 26 | #include <signal.h> | 25 | #include <signal.h> |
| 27 | #include <stdlib.h> | 26 | #include <stdlib.h> |
| 27 | #include <glib.h> | ||
| 28 | 28 | ||
| 29 | #include <libimobiledevice/libimobiledevice.h> | 29 | #include <libimobiledevice/libimobiledevice.h> |
| 30 | #include <libimobiledevice/lockdown.h> | 30 | #include <libimobiledevice/lockdown.h> |
| @@ -118,7 +118,7 @@ int main(int argc, char *argv[]) | |||
| 118 | uint32_t datalen = 0, bytes = 0, recv_bytes = 0; | 118 | uint32_t datalen = 0, bytes = 0, recv_bytes = 0; |
| 119 | 119 | ||
| 120 | ret = idevice_connection_receive(conn, (char *) &datalen, sizeof(datalen), &bytes); | 120 | ret = idevice_connection_receive(conn, (char *) &datalen, sizeof(datalen), &bytes); |
| 121 | datalen = ntohl(datalen); | 121 | datalen = GUINT32_FROM_BE(datalen); |
| 122 | 122 | ||
| 123 | if (datalen == 0) | 123 | if (datalen == 0) |
| 124 | continue; | 124 | continue; |
