diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-10-29 11:44:24 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-10-29 11:57:20 +0100 |
commit | fe7d46d49a821521f68ca7786fb5d7665528c0e3 (patch) | |
tree | 967e4a0279c2e6e5d62228c19ac29d2756c79f39 /libqmi-glib | |
parent | 482ce26d0f30f1e89e55eb98e0cb475df0a1c869 (diff) |
libqmi-glib,utils: no need to pass endianness when reading/writing single bytes
Diffstat (limited to 'libqmi-glib')
-rw-r--r-- | libqmi-glib/qmi-utils.c | 10 | ||||
-rw-r--r-- | libqmi-glib/qmi-utils.h | 4 | ||||
-rw-r--r-- | libqmi-glib/test/test-utils.c | 8 |
3 files changed, 4 insertions, 18 deletions
diff --git a/libqmi-glib/qmi-utils.c b/libqmi-glib/qmi-utils.c index 2b7d8fc..4341eee 100644 --- a/libqmi-glib/qmi-utils.c +++ b/libqmi-glib/qmi-utils.c @@ -102,7 +102,6 @@ print_read_bytes_trace (const gchar *type, * qmi_utils_read_guint8_from_buffer: * @buffer: a buffer with raw binary data. * @buffer_size: size of @buffer. - * @endian: ignored * @out: return location for the read variable. * * Reads an unsigned byte from the buffer. @@ -116,7 +115,6 @@ print_read_bytes_trace (const gchar *type, void qmi_utils_read_guint8_from_buffer (const guint8 **buffer, guint16 *buffer_size, - QmiEndian endian, guint8 *out) { g_assert (out != NULL); @@ -136,7 +134,6 @@ qmi_utils_read_guint8_from_buffer (const guint8 **buffer, * qmi_utils_read_gint8_from_buffer: * @buffer: a buffer with raw binary data. * @buffer_size: size of @buffer. - * @endian: ignored * @out: return location for the read variable. * * Reads a signed byte from the buffer. @@ -150,7 +147,6 @@ qmi_utils_read_guint8_from_buffer (const guint8 **buffer, void qmi_utils_read_gint8_from_buffer (const guint8 **buffer, guint16 *buffer_size, - QmiEndian endian, gint8 *out) { g_assert (out != NULL); @@ -452,7 +448,6 @@ qmi_utils_read_sized_guint_from_buffer (const guint8 **buffer, * qmi_utils_write_guint8_to_buffer: * @buffer: a buffer. * @buffer_size: size of @buffer. - * @endian: ignored * @in: location of the variable to be written. * * Writes an unsigned byte into the buffer. @@ -465,7 +460,6 @@ qmi_utils_read_sized_guint_from_buffer (const guint8 **buffer, void qmi_utils_write_guint8_to_buffer (guint8 **buffer, guint16 *buffer_size, - QmiEndian endian, guint8 *in) { g_assert (in != NULL); @@ -483,7 +477,6 @@ qmi_utils_write_guint8_to_buffer (guint8 **buffer, * qmi_utils_write_gint8_to_buffer: * @buffer: a buffer. * @buffer_size: size of @buffer. - * @endian: ignored * @in: location of the variable to be written. * * Writes a signed byte into the buffer. @@ -496,7 +489,6 @@ qmi_utils_write_guint8_to_buffer (guint8 **buffer, void qmi_utils_write_gint8_to_buffer (guint8 **buffer, guint16 *buffer_size, - QmiEndian endian, gint8 *in) { g_assert (in != NULL); @@ -827,7 +819,6 @@ qmi_utils_read_string_from_buffer (const guint8 **buffer, case 8: qmi_utils_read_guint8_from_buffer (buffer, buffer_size, - QMI_ENDIAN_LITTLE, &string_length_8); string_length = string_length_8; break; @@ -930,7 +921,6 @@ qmi_utils_write_string_to_buffer (guint8 **buffer, len_8 = (guint8)len; qmi_utils_write_guint8_to_buffer (buffer, buffer_size, - QMI_ENDIAN_LITTLE, &len_8); break; case 16: diff --git a/libqmi-glib/qmi-utils.h b/libqmi-glib/qmi-utils.h index d2e79d0..3f39182 100644 --- a/libqmi-glib/qmi-utils.h +++ b/libqmi-glib/qmi-utils.h @@ -49,11 +49,9 @@ typedef enum { void qmi_utils_read_guint8_from_buffer (const guint8 **buffer, guint16 *buffer_size, - QmiEndian endian, guint8 *out); void qmi_utils_read_gint8_from_buffer (const guint8 **buffer, guint16 *buffer_size, - QmiEndian endian, gint8 *out); void qmi_utils_read_guint16_from_buffer (const guint8 **buffer, @@ -91,11 +89,9 @@ void qmi_utils_read_sized_guint_from_buffer (const guint8 **buffer, void qmi_utils_write_guint8_to_buffer (guint8 **buffer, guint16 *buffer_size, - QmiEndian endian, guint8 *in); void qmi_utils_write_gint8_to_buffer (guint8 **buffer, guint16 *buffer_size, - QmiEndian endian, gint8 *in); void qmi_utils_write_guint16_to_buffer (guint8 **buffer, diff --git a/libqmi-glib/test/test-utils.c b/libqmi-glib/test/test-utils.c index 37b9a74..bba1c0e 100644 --- a/libqmi-glib/test/test-utils.c +++ b/libqmi-glib/test/test-utils.c @@ -46,8 +46,8 @@ test_utils_uint8 (void) while (in_buffer_size) { guint8 tmp; - qmi_utils_read_guint8_from_buffer (&in_buffer_walker, &in_buffer_size, QMI_ENDIAN_LITTLE, &tmp); - qmi_utils_write_guint8_to_buffer (&out_buffer_walker, &out_buffer_size, QMI_ENDIAN_LITTLE, &tmp); + qmi_utils_read_guint8_from_buffer (&in_buffer_walker, &in_buffer_size, &tmp); + qmi_utils_write_guint8_to_buffer (&out_buffer_walker, &out_buffer_size, &tmp); } g_assert_cmpuint (out_buffer_size, ==, 0); @@ -75,8 +75,8 @@ test_utils_int8 (void) while (in_buffer_size) { gint8 tmp; - qmi_utils_read_gint8_from_buffer (&in_buffer_walker, &in_buffer_size, QMI_ENDIAN_LITTLE, &tmp); - qmi_utils_write_gint8_to_buffer (&out_buffer_walker, &out_buffer_size, QMI_ENDIAN_LITTLE, &tmp); + qmi_utils_read_gint8_from_buffer (&in_buffer_walker, &in_buffer_size, &tmp); + qmi_utils_write_gint8_to_buffer (&out_buffer_walker, &out_buffer_size, &tmp); } g_assert_cmpuint (out_buffer_size, ==, 0); |