aboutsummaryrefslogtreecommitdiffstats
path: root/build-aux
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2012-10-29 11:44:24 +0100
committerAleksander Morgado <aleksander@lanedo.com>2012-10-29 11:57:20 +0100
commitfe7d46d49a821521f68ca7786fb5d7665528c0e3 (patch)
tree967e4a0279c2e6e5d62228c19ac29d2756c79f39 /build-aux
parent482ce26d0f30f1e89e55eb98e0cb475df0a1c869 (diff)
downloadexternal_libqmi-fe7d46d49a821521f68ca7786fb5d7665528c0e3.zip
external_libqmi-fe7d46d49a821521f68ca7786fb5d7665528c0e3.tar.gz
external_libqmi-fe7d46d49a821521f68ca7786fb5d7665528c0e3.tar.bz2
libqmi-glib,utils: no need to pass endianness when reading/writing single bytes
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/qmi-codegen/VariableInteger.py35
1 files changed, 25 insertions, 10 deletions
diff --git a/build-aux/qmi-codegen/VariableInteger.py b/build-aux/qmi-codegen/VariableInteger.py
index 68692a0..b891283 100644
--- a/build-aux/qmi-codegen/VariableInteger.py
+++ b/build-aux/qmi-codegen/VariableInteger.py
@@ -75,8 +75,11 @@ class VariableInteger(Variable):
'${lp}/* Read the ${private_format} variable from the buffer */\n'
'${lp}qmi_utils_read_${private_format}_from_buffer (\n'
'${lp} &${buffer_name},\n'
- '${lp} &${buffer_len},\n'
- '${lp} ${endian},\n'
+ '${lp} &${buffer_len},\n')
+ if self.private_format != 'guint8' and self.private_format != 'gint8':
+ template += (
+ '${lp} ${endian},\n')
+ template += (
'${lp} &(${variable_name}));\n')
else:
template = (
@@ -86,8 +89,11 @@ class VariableInteger(Variable):
'${lp} /* Read the ${private_format} variable from the buffer */\n'
'${lp} qmi_utils_read_${private_format}_from_buffer (\n'
'${lp} &${buffer_name},\n'
- '${lp} &${buffer_len},\n'
- '${lp} ${endian},\n'
+ '${lp} &${buffer_len},\n')
+ if self.private_format != 'guint8' and self.private_format != 'gint8':
+ template += (
+ '${lp} ${endian},\n')
+ template += (
'${lp} &tmp);\n'
'${lp} ${variable_name} = (${public_format})tmp;\n'
'${lp}}\n')
@@ -120,8 +126,11 @@ class VariableInteger(Variable):
'${lp}/* Write the ${private_format} variable to the buffer */\n'
'${lp}qmi_utils_write_${private_format}_to_buffer (\n'
'${lp} &${buffer_name},\n'
- '${lp} &${buffer_len},\n'
- '${lp} ${endian},\n'
+ '${lp} &${buffer_len},\n')
+ if self.private_format != 'guint8' and self.private_format != 'gint8':
+ template += (
+ '${lp} ${endian},\n')
+ template += (
'${lp} &(${variable_name}));\n')
else:
template = (
@@ -132,8 +141,11 @@ class VariableInteger(Variable):
'${lp} /* Write the ${private_format} variable to the buffer */\n'
'${lp} qmi_utils_write_${private_format}_to_buffer (\n'
'${lp} &${buffer_name},\n'
- '${lp} &${buffer_len},\n'
- '${lp} ${endian},\n'
+ '${lp} &${buffer_len},\n')
+ if self.private_format != 'guint8' and self.private_format != 'gint8':
+ template += (
+ '${lp} ${endian},\n')
+ template += (
'${lp} &tmp);\n'
'${lp}}\n')
f.write(string.Template(template).substitute(translations))
@@ -199,8 +211,11 @@ class VariableInteger(Variable):
'${lp} /* Read the ${private_format} variable from the buffer */\n'
'${lp} qmi_utils_read_${private_format}_from_buffer (\n'
'${lp} &${buffer_name},\n'
- '${lp} &${buffer_len},\n'
- '${lp} ${endian},\n'
+ '${lp} &${buffer_len},\n')
+ if self.private_format != 'guint8' and self.private_format != 'gint8':
+ template += (
+ '${lp} ${endian},\n')
+ template += (
'${lp} &tmp);\n'
'\n'
'${lp} g_string_append_printf (${printable}, "${common_format}", ${common_cast}tmp);\n'