Skip to contentSkip to conversation

Fix: add missing semicolons after MSG, DBG, ERR print macros

PATCH New Mathieu Desnoyers 2 participants 4 messages May 19, 2016 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/4 Fix: add missing semicolons after MSG, DBG, ERR print macros

---
 src/bin/lttng/commands/add_context.c | 2 +-
 src/common/consumer/consumer.c       | 2 +-
 src/common/runas.c                   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
src/bin/lttng/commands/add_context.c +1 -1
index 8f8aa30..2f43dc7 100644
@@ -609,7 +609,7 @@ static int add_context(char *session_name)
 						opt_channel_name);
 			} else {
 				MSG("%s context %s added to all channels",
-						get_domain_str(dom.type), type->opt->symbol)
+						get_domain_str(dom.type), type->opt->symbol);
 			}
 			success = 1;
 		}
src/common/consumer/consumer.c +1 -1
index 8b8e74c..7ce294e 100644
@@ -1021,7 +1021,7 @@ struct lttng_consumer_channel *consumer_allocate_channel(uint64_t key,
 
 	CDS_INIT_LIST_HEAD(&channel->streams.head);
 
-	DBG("Allocated channel (key %" PRIu64 ")", channel->key)
+	DBG("Allocated channel (key %" PRIu64 ")", channel->key);
 
 end:
 	return channel;
src/common/runas.c +1 -1
index b4828ad..2a71f58 100644
@@ -171,7 +171,7 @@ run_as_fct run_as_enum_to_fct(enum run_as_cmd cmd)
 	case RUN_AS_MKDIR_RECURSIVE:
 		return _mkdir_recursive;
 	default:
-		ERR("Unknown command %d", (int) cmd)
+		ERR("Unknown command %d", (int) cmd);
 		return NULL;
 	}
 }
Signature · 6 lines
2.1.4

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#2 lore raw

PATCH 2/4 Fix: coding style document has erroneous semicolon at end of macro

In reply to a message not in the archive
---
 CodingStyle | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
CodingStyle +1 -1
index 8833180..1d8bd9b 100644
@@ -36,7 +36,7 @@ Use space to indent the '\' at the end but tabs at the beginning.
 #define a_macro(x)      \
 	do {                \
 		fsync();        \
-	} while (0);        \
+	} while (0)
 
 It's really the only time we use spaces. For everything else, there is TABS! :)
 
Signature · 6 lines
2.1.4

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#3 lore raw

PATCH 3/4 Update coding style document for macro style

In reply to a message not in the archive
---
 CodingStyle | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
CodingStyle +13 -5
index 1d8bd9b..6ff931b 100644
@@ -31,14 +31,22 @@ enum my_enum {
 #define DEFAULT_VALUE_OF_SOME_SORT   6
 #define THE_ANSWER                   42
 
-Use space to indent the '\' at the end but tabs at the beginning.
+Use either a single space or tabs to indent the '\' at the end of lines.
+Use tabs at the beginning of lines.
 
-#define a_macro(x)      \
-	do {                \
-		fsync();        \
+Either:
+
+#define a_macro(x) \
+	do { \
+		fsync(); \
 	} while (0)
 
-It's really the only time we use spaces. For everything else, there is TABS! :)
+or
+
+#define a_macro(x)		\
+	do {			\
+		fsync();	\
+	} while (0)
 
 Here is a pretty cool vim macro that will highlight your whitespaces and spaces
 before tab. This helps a *LOT* when coding.
Signature · 6 lines
2.1.4

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

All four patches merged, thanks!

Jérémie

Quoted 49 lines · Mathieu Desnoyers
---
 src/bin/lttng/commands/add_context.c | 2 +-
 src/common/consumer/consumer.c       | 2 +-
 src/common/runas.c                   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
src/bin/lttng/commands/add_context.c +1 -1
index 8f8aa30..2f43dc7 100644
@@ -609,7 +609,7 @@ static int add_context(char *session_name)
                                                opt_channel_name);
                        } else {
                                MSG("%s context %s added to all channels",
-                                               get_domain_str(dom.type), type->opt->symbol)
+                                               get_domain_str(dom.type), type->opt->symbol);
                        }
                        success = 1;
                }
src/common/consumer/consumer.c +1 -1
index 8b8e74c..7ce294e 100644
@@ -1021,7 +1021,7 @@ struct lttng_consumer_channel *consumer_allocate_channel(uint64_t key,
 
        CDS_INIT_LIST_HEAD(&channel->streams.head);
 
-       DBG("Allocated channel (key %" PRIu64 ")", channel->key)
+       DBG("Allocated channel (key %" PRIu64 ")", channel->key);
 
 end:
        return channel;
src/common/runas.c +1 -2
index b4828ad..2a71f58 100644
@@ -171,7 +171,7 @@ run_as_fct run_as_enum_to_fct(enum run_as_cmd cmd)
        case RUN_AS_MKDIR_RECURSIVE:
                return _mkdir_recursive;
        default:
-               ERR("Unknown command %d", (int) cmd)
+               ERR("Unknown command %d", (int) cmd);
                return NULL;
        }
 }
--

2.1.4

Signature · 7 lines
Jérémie Galarneau
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev