[glibmm] gmmproc: Remove M4 warnings due to commas in return types.
- From: Josà Alburquerque <jaalburqu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] gmmproc: Remove M4 warnings due to commas in return types.
- Date: Wed, 19 Oct 2011 17:07:47 +0000 (UTC)
commit 02bc2983b42143b3dd2a7fc479025eb856692195
Author: Josà Alburquerque <jaalburqu svn gnome org>
Date: Wed Oct 19 13:05:22 2011 -0400
gmmproc: Remove M4 warnings due to commas in return types.
* tools/m4/convert_base.m4 (__HASH2): Appropriately quote the
pushdef() arguments and the m4_ifelse() arguments due to some warnings
generated because of the newly wrapped method in the
ApplicationCommandLine class (get_platform_data()) which has a comma
in the return type. The wrapping was successful even with the warning
but the return type was still being split when passed to this macro.
Document what the macro does.
(_CONVERT): Typos.
(_CONVERSION):
(_INITIALIZATION): Document what parameters are allowed for these
macros.
ChangeLog | 16 ++++++++++++++++
tools/m4/convert_base.m4 | 22 +++++++++++++++++-----
2 files changed, 33 insertions(+), 5 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fade3f8..1a32297 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2011-10-16 Josà Alburquerque <jaalburqu svn gnome org>
+
+ gmmproc: Remove M4 warnings due to commas in return types.
+
+ * tools/m4/convert_base.m4 (__HASH2): Appropriately quote the
+ pushdef() arguments and the m4_ifelse() arguments due to some warnings
+ generated because of the newly wrapped method in the
+ ApplicationCommandLine class (get_platform_data()) which has a comma
+ in the return type. The wrapping was successful even with the warning
+ but the return type was still being split when passed to this macro.
+ Document what the macro does.
+ (_CONVERT): Typos.
+ (_CONVERSION):
+ (_INITIALIZATION): Document what parameters are allowed for these
+ macros.
+
2011-10-13 Josà Alburquerque <jaalburqu svn gnome org>
Gio::DBus::Connection: Correct UnixFDList class forward declaration.
diff --git a/tools/m4/convert_base.m4 b/tools/m4/convert_base.m4
index eb07c1e..aabbc70 100644
--- a/tools/m4/convert_base.m4
+++ b/tools/m4/convert_base.m4
@@ -6,16 +6,26 @@ dnl $Id$
define(`__HASH',`__`'m4_translit(`$*',`ABCDEFGHIJKLMNOPQRSTUVWXYZ<>[]&*, ',`abcdefghijklmnopqrstuvwxyzVBNMRSC_')`'')
define(`__EQUIV',`m4_ifdef(EV`'__HASH(`$1'),EV`'__HASH(`$1'),`$1')')
+dnl __HASH2(firsttype, secondtype)
+dnl
+dnl Provides a textual combination of the two given types which can be used as
+dnl a hash to store and retrieve conversions and initializations. It first
+dnl sees if the two types have equivalent types that should be used in their
+dnl places (using the __EQUIV macro above). Since the types returned by
+dnl __EQUIV may contain commas (because of types such as std::map<>), quote the
+dnl call to the macro to avoid the types to be interpreted as more than one
+dnl argument to the pushdef() calls. Also quote the expansion of the __E1 and
+dnl __E2 macros in the m4_ifelse for the same reason.
define(`__HASH2',`dnl
-pushdef(`__E1',__EQUIV(`$1'))pushdef(`__E2',__EQUIV(`$2'))dnl
-m4_ifelse(__E1,__E2,`__EQ',__HASH(__E1)`'__HASH(__E2))`'dnl
+pushdef(`__E1',`__EQUIV(`$1')')pushdef(`__E2',`__EQUIV(`$2')')dnl
+m4_ifelse(_QUOTE(__E1),_QUOTE(__E2),`__EQ',__HASH(__E1)`'__HASH(__E2))`'dnl
popdef(`__E1')popdef(`__E2')`'')
define(`CF__EQ',`$3')
-#
# _CONVERT(fromtype, totype, name, wrap_line)
-# Print the conversion from ctype to cpptype
+#
+# Print the conversion from 'fromtype' to 'totype'
define(`_CONVERT',`dnl
m4_ifelse(`$2',void,`$3',`dnl
pushdef(`__COV',`CF`'__HASH2(`$1',`$2')')dnl
@@ -28,6 +38,7 @@ m4_m4exit(1)
')
+# _CONVERSION(fromtype, totype, conversion)
#
# Functions for populating the tables.
#
@@ -35,8 +46,8 @@ define(`_CONVERSION',`
m4_ifelse(`$3',,,`define(CF`'__HASH2(`$1',`$2'),`$3')')
')
-#
# _INITIALIZE(target_type, fromtype, output_param_name, c_return, wrap_line)
+#
# Print an initialize statement from ctype to cpptype
define(`_INITIALIZE',`dnl
m4_ifelse(`$1',void,`$4',`dnl
@@ -49,6 +60,7 @@ m4_m4exit(1)
')`'dnl
')
+# _INITIALIZATION(fromtype, totype, initialization)
#
# Functions for populating initialization tables.
#
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]