trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jpe...@apache.org
Subject [04/17] git commit: TS-2302: add TS_NONNULL compiler attribute
Date Thu, 31 Oct 2013 15:18:23 GMT
TS-2302: add TS_NONNULL compiler attribute


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/6eccf8c5
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/6eccf8c5
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/6eccf8c5

Branch: refs/heads/master
Commit: 6eccf8c5f2d4f4d1988eb0bdea86f3f150e3fe52
Parents: a7b448b
Author: James Peach <jpeach@apache.org>
Authored: Tue Oct 8 16:02:25 2013 -0700
Committer: James Peach <jpeach@apache.org>
Committed: Thu Oct 31 08:16:27 2013 -0700

----------------------------------------------------------------------
 lib/ts/ink_apidefs.h      | 8 ++++++++
 proxy/logging/LogObject.h | 5 +++--
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6eccf8c5/lib/ts/ink_apidefs.h
----------------------------------------------------------------------
diff --git a/lib/ts/ink_apidefs.h b/lib/ts/ink_apidefs.h
index 33c0f6f..16f1bb9 100644
--- a/lib/ts/ink_apidefs.h
+++ b/lib/ts/ink_apidefs.h
@@ -63,6 +63,14 @@
 #endif
 #endif
 
+#if !defined(TS_NONNULL)
+#if defined(__GNUC__) || defined(__clang__)
+#define TS_NONNULL(...) __attribute__((nonnull (__VA_ARGS__)))
+#else
+#define TS_NONNULL(...)
+#endif
+#endif
+
 #if !defined(TS_INLINE)
 #define TS_INLINE inline
 #endif

http://git-wip-us.apache.org/repos/asf/trafficserver/blob/6eccf8c5/proxy/logging/LogObject.h
----------------------------------------------------------------------
diff --git a/proxy/logging/LogObject.h b/proxy/logging/LogObject.h
index 0b8bf52..48be36a 100644
--- a/proxy/logging/LogObject.h
+++ b/proxy/logging/LogObject.h
@@ -96,11 +96,12 @@ public:
   //              it should not be destroyed during a reconfiguration
   // WRITES_TO_PIPE: object writes to a named pipe rather than to a file
 
-  LogObject(LogFormat *format, const char *log_dir, const char *basename,
+  LogObject(const LogFormat *format, const char *log_dir, const char *basename,
                  LogFileFormat file_format, const char *header,
                  int rolling_enabled, int flush_threads,
                  int rolling_interval_sec = 0, int rolling_offset_hr = 0,
-                 int rolling_size_mb = 0, bool auto_created = false);
+                 int rolling_size_mb = 0, bool auto_created = false)
+    TS_NONNULL(2 /* format is required */);
   LogObject(LogObject &);
   virtual ~LogObject();
 


Mime
View raw message