[sr-dev] git:master:a9ec529e: cnxcc: define inline functions in cnxcc.h

grumvalski federico.cabiddu at gmail.com
Tue Dec 22 15:47:14 CET 2015


Module: kamailio
Branch: master
Commit: a9ec529ecee015e79dc60cb8ba8a6686cdf73a7b
URL: https://github.com/kamailio/kamailio/commit/a9ec529ecee015e79dc60cb8ba8a6686cdf73a7b

Author: grumvalski <federico.cabiddu at gmail.com>
Committer: grumvalski <federico.cabiddu at gmail.com>
Date: 2015-12-22T13:48:19+01:00

cnxcc: define inline functions in cnxcc.h

---

Modified: modules/cnxcc/cnxcc.c
Modified: modules/cnxcc/cnxcc.h

---

Diff:  https://github.com/kamailio/kamailio/commit/a9ec529ecee015e79dc60cb8ba8a6686cdf73a7b.diff
Patch: https://github.com/kamailio/kamailio/commit/a9ec529ecee015e79dc60cb8ba8a6686cdf73a7b.patch

---

diff --git a/modules/cnxcc/cnxcc.c b/modules/cnxcc/cnxcc.c
index e869af4..3d21b3d 100644
--- a/modules/cnxcc/cnxcc.c
+++ b/modules/cnxcc/cnxcc.c
@@ -28,30 +28,6 @@
 
 #include "cnxcc.h"
 
-inline void get_datetime(str *dest)
-{
-	timestamp2isodt(dest, get_current_timestamp());
-}
-
-inline unsigned int get_current_timestamp()
-{
-	return time(NULL);
-}
-
-inline int timestamp2isodt(str *dest, unsigned int timestamp)
-{
-	time_t  		tim;
-	struct tm 		*tmPtr;
-
-	tim 		= timestamp;
-	tmPtr 		= localtime(&tim);
-
-	strftime( dest->s, DATETIME_SIZE, "%Y-%m-%d %H:%M:%S", tmPtr);
-	dest->len	= DATETIME_LENGTH;
-
-	return 0;
-}
-
 double str2double(str *string)
 {
 	char buffer[string->len + 1];
diff --git a/modules/cnxcc/cnxcc.h b/modules/cnxcc/cnxcc.h
index 9454e16..3973eab 100644
--- a/modules/cnxcc/cnxcc.h
+++ b/modules/cnxcc/cnxcc.h
@@ -31,9 +31,30 @@
 #define DATETIME_LENGTH		DATETIME_SIZE - 1
 
 
-inline void get_datetime(str *dest);
-inline unsigned int get_current_timestamp();
-inline int timestamp2isodt(str *dest, unsigned int timestamp);
+static inline unsigned int get_current_timestamp()
+{
+	return time(NULL);
+}
+
+static inline int timestamp2isodt(str *dest, unsigned int timestamp)
+{
+	time_t  		tim;
+	struct tm 		*tmPtr;
+
+	tim 		= timestamp;
+	tmPtr 		= localtime(&tim);
+
+	strftime( dest->s, DATETIME_SIZE, "%Y-%m-%d %H:%M:%S", tmPtr);
+	dest->len	= DATETIME_LENGTH;
+
+	return 0;
+}
+
+static inline void get_datetime(str *dest)
+{
+	timestamp2isodt(dest, get_current_timestamp());
+}
+
 double str2double(str *string);
 
 #endif /* _CNXCC_H */




More information about the sr-dev mailing list