freecwmp
[Top] [All Lists]

[PATCH] move static struct cwmp from cwmp.h to cwmp.c

To: freecwmp@linux-mips.org
Subject: [PATCH] move static struct cwmp from cwmp.h to cwmp.c
From: Jonas Gorski <jonas.gorski@gmail.com>
Date: Mon, 23 Jul 2012 17:34:53 +0200
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:x-mailer; bh=3nUPgirk5rstwf/oYvIoEXR6Tk8ArRFFTsfQv7gbOM0=; b=dXd8EXeg9VPy2xnAHMdm4iwnQBF6jwTWrYdTJA0cDfiKOHVMC5RoAcvPNmH/M9bwVG 7WJHiMzRby7MOVGKnD7l3o5xFpjIOQGY4xMD0VYbTTGG7qm5CkEzUkllMcZQQH7NQYc9 HH6jBjf29BuLINo6VWkT/1PGfbroCH95bweBJDNAzeXGVF6XAfrodJp/68ZdCGZTSNeL 8Nx5JALrHUsjuD6dIVrPfhmeXoZab1DWMZkRkpeEn7vCxPh1S938iSmWZqW0C409GpE3 YBohMu9R8RTwlBxCiMsOdi/THTRpo3yoVi55umUoIpMU8NleN+bRnZXRaGapy3ejIME3 cFvw==
Original-recipient: rfc822;freecwmp@linux-mips.org
Sender: freecwmp-bounce@linux-mips.org
This prevents a copy of it being allocated for every source file
including cwmp.h. Reduces memory usage by
(NUM_USERS - 1) * sizeof(cwmp).

Contributed by T-Labs, Deutsche Telekom Innovation Laboratories

Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
 src/cwmp/cwmp.c |   13 +++++++++++++
 src/cwmp/cwmp.h |   13 -------------
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/cwmp/cwmp.c b/src/cwmp/cwmp.c
index b74311d..075c6fa 100644
--- a/src/cwmp/cwmp.c
+++ b/src/cwmp/cwmp.c
@@ -15,6 +15,19 @@
 #include "../http/http.h"
 #include "../xml/xml.h"
 
+static struct cwmp
+{
+       enum cwmp_event_code event_code;
+       struct uloop_timeout connection_request_t;
+       struct uloop_timeout periodic_inform_t;
+       int8_t periodic_inform_enabled;
+       int64_t periodic_inform_interval;
+       struct uloop_timeout acs_error_t;
+       int8_t retry_count;
+       int8_t acs_reload_required;
+       int8_t acs_connection_required;
+} cwmp;
+
 int8_t
 cwmp_init(void)
 {
diff --git a/src/cwmp/cwmp.h b/src/cwmp/cwmp.h
index 729ddb3..8277f91 100644
--- a/src/cwmp/cwmp.h
+++ b/src/cwmp/cwmp.h
@@ -26,19 +26,6 @@ enum cwmp_event_code
        REQUEST_DOWNLOAD, 
        AUTONOMOUS_TRANSFER_COMPLETE 
 }; 
-                                                                               
         
-static struct cwmp
-{
-       enum cwmp_event_code event_code;
-       struct uloop_timeout connection_request_t;
-       struct uloop_timeout periodic_inform_t;
-       int8_t periodic_inform_enabled;
-       int64_t periodic_inform_interval;
-       struct uloop_timeout acs_error_t;
-       int8_t retry_count;
-       int8_t acs_reload_required;
-       int8_t acs_connection_required;
-} cwmp;
 
 static void cwmp_periodic_inform(struct uloop_timeout *);
 
-- 
1.7.10


<Prev in Thread] Current Thread [Next in Thread>