gnokii-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-55


From: Daniele Forsi
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-554-g881fd48
Date: Sat, 11 Jan 2014 12:40:29 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "libgnokii and core programs".

The branch, master has been updated
       via  881fd48aadfa2e77ea332536063bcc145b864cb2 (commit)
      from  c06c985dab74469734e92e176f61a59d2444d5fa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=881fd48aadfa2e77ea332536063bcc145b864cb2


commit 881fd48aadfa2e77ea332536063bcc145b864cb2
Author: Daniele Forsi <address@hidden>
Date:   Sat Jan 11 13:37:47 2014 +0100

    Refactor register_driver()
    
    Do not allocate memory if it is not going to be used and no need to
    use two pointers.

diff --git a/common/gsm-api.c b/common/gsm-api.c
index 341ca27..cefc161 100644
--- a/common/gsm-api.c
+++ b/common/gsm-api.c
@@ -75,21 +75,22 @@ BOOL APIENTRY DllMain(HANDLE hModule,
    user must have write permission to the device. */
 static gn_error register_driver(gn_driver *driver, const char *model, char 
*setupmodel, struct gn_statemachine *sm)
 {
-       gn_data *data = NULL;
-       gn_data *p_data;
-       gn_error error = GN_ERR_UNKNOWNMODEL;
+       gn_data *data;
+       gn_error error;
+
+       if (strstr(driver->phone.models, model) == NULL)
+               return GN_ERR_UNKNOWNMODEL;
 
        if (setupmodel) {
                data = calloc(1, sizeof(gn_data));
                if (!data)
                        return GN_ERR_INTERNALERROR;
                data->model = setupmodel;
-               p_data = data;
        } else {
-               p_data = NULL;
+               data = NULL;
        }
-       if (strstr(driver->phone.models, model) != NULL)
-               error = driver->functions(GN_OP_Init, p_data, sm);
+
+       error = driver->functions(GN_OP_Init, data, sm);
 
        free(data);
        return error;

-----------------------------------------------------------------------

Summary of changes:
 common/gsm-api.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]