From: SF Markus Elfring <elfring at users.sourceforge.net>
To: powertop@lists.01.org
Subject: [Powertop] Addition of two include guards?
Date: Sat, 01 Nov 2014 19:04:01 +0100 [thread overview]
Message-ID: <54552091.4010609@users.sourceforge.net> (raw)
[-- Attachment #1: Type: text/plain, Size: 248 bytes --]
Hello,
I suggest to add include guards to two header files so that their reuse might
become a bit safer.
https://www.securecoding.cert.org/confluence/display/cplusplus/PRE06-CPP.+Enclose+header+files+in+an+inclusion+guard
Regards,
Markus
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Addition-of-two-include-guards.patch --]
[-- Type: text/x-patch, Size: 1561 bytes --]
>From fd7d3c5927aac8c474ac44f5b0e00f5768a8cb24 Mon Sep 17 00:00:00 2001
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 1 Nov 2014 18:58:38 +0100
Subject: [PATCH] Addition of two include guards
Unique include guards were added to two header files to make their reuse
a bit safer.
https://www.securecoding.cert.org/confluence/display/cplusplus/PRE06-CPP.+Enclose+header+files+in+an+inclusion+guard
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
src/cpu/intel_cpus.h | 4 ++++
src/report/report-data-html.h | 4 ++++
2 files changed, 8 insertions(+)
diff --git a/src/cpu/intel_cpus.h b/src/cpu/intel_cpus.h
index cde4a2d..810a243 100644
--- a/src/cpu/intel_cpus.h
+++ b/src/cpu/intel_cpus.h
@@ -1,3 +1,5 @@
+#ifndef PowerTop_INTEL_CPUS_H_84F09FB4F519470FA914AA9B02453221
+#define PowerTop_INTEL_CPUS_H_84F09FB4F519470FA914AA9B02453221
/*
* Copyright 2010, Intel Corporation
*
@@ -171,3 +173,5 @@ public:
int is_supported_intel_cpu(int model);
int byt_has_ahci();
+
+#endif
diff --git a/src/report/report-data-html.h b/src/report/report-data-html.h
index 616b294..fa796e9 100644
--- a/src/report/report-data-html.h
+++ b/src/report/report-data-html.h
@@ -1,3 +1,6 @@
+#ifndef PowerTop_REPORT_DATA_HTML_H_C58C116411234A34AC2EFB8D23A69713
+#define PowerTop_REPORT_DATA_HTML_H_C58C116411234A34AC2EFB8D23A69713
+
#include <string>
#include <sstream>
@@ -67,3 +70,4 @@ init_tune_table_attr(struct table_attributes *table_css, int rows, int cols);
string
double_to_string(double dval);
+#endif
--
2.1.3
next reply other threads:[~2014-11-01 18:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-01 18:04 SF Markus Elfring [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-11-02 19:17 [Powertop] Addition of two include guards? Alexandra Yates
2014-11-14 4:42 Alexandra Yates
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54552091.4010609@users.sourceforge.net \
--to=powertop@lists.01.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.