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-48


From: Daniele Forsi
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-489-gd118734
Date: Wed, 24 Apr 2013 19:17:49 +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  d118734b87547562c1742d6393d49c59b8a93ab5 (commit)
      from  b1093814a5682b7fee56d214f78a8e07778d66d5 (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=d118734b87547562c1742d6393d49c59b8a93ab5


commit d118734b87547562c1742d6393d49c59b8a93ab5
Author: Daniele Forsi <address@hidden>
Date:   Wed Apr 24 18:50:00 2013 +0200

    Do not check the value returned by g_malloc()
    
    Program is aborted if g_malloc() can't allocate memory (NULL is returned 
only if
    n_bytes is zero, which can't happen here because all arguments are 
constant).
    https://developer.gnome.org/glib/stable/glib-Memory-Allocation.html#g-malloc
    This also removes some translatable strings and uneeded casts.

diff --git a/xgnokii/xgnokii_calendar.c b/xgnokii/xgnokii_calendar.c
index 92e0860..543df56 100644
--- a/xgnokii/xgnokii_calendar.c
+++ b/xgnokii/xgnokii_calendar.c
@@ -1671,11 +1671,7 @@ void GUI_CreateCalendarWindow()
        gtk_clist_set_column_justification(GTK_CLIST(cal.notesClist), 0, 
GTK_JUSTIFY_RIGHT);
 
        for (i = 0; i < ENTRY_COLUMNS; i++) {
-               if ((sColumn = g_malloc(sizeof(SortColumn))) == NULL) {
-                       g_print(_("Error: %s: line %d: Can't allocate 
memory!\n"), __FILE__,
-                               __LINE__);
-                       gtk_main_quit();
-               }
+               sColumn = g_malloc(sizeof(SortColumn));
                sColumn->clist = cal.notesClist;
                sColumn->column = i;
                
gtk_signal_connect(GTK_OBJECT(GTK_CLIST(cal.notesClist)->column[i].button),
diff --git a/xgnokii/xgnokii_cfg.c b/xgnokii/xgnokii_cfg.c
index 953d3e1..53e12aa 100644
--- a/xgnokii/xgnokii_cfg.c
+++ b/xgnokii/xgnokii_cfg.c
@@ -97,11 +97,7 @@ void GUI_ReadXConfig()
 
        g_free(rcfile);
 
-       if ((line = (char *) g_malloc(255)) == NULL) {
-               g_print(_("WARNING: Can't allocate memory for config 
reading!\n"));
-               fclose(file);
-               return;
-       }
+       line = g_malloc(255);
 
        while (fgets(line, 255, file) != NULL) {
                gint v;
diff --git a/xgnokii/xgnokii_contacts.c b/xgnokii/xgnokii_contacts.c
index 06a0328..4370619 100644
--- a/xgnokii/xgnokii_contacts.c
+++ b/xgnokii/xgnokii_contacts.c
@@ -2260,13 +2260,7 @@ static gint InsertPBEntryME(gn_phonebook_entry * entry)
 {
        PhonebookEntry *pbEntry;
 
-       if ((pbEntry = (PhonebookEntry *) g_malloc(sizeof(PhonebookEntry))) == 
NULL) {
-               g_print(_("Error: %s: line %d: Can't allocate memory!\n"), 
__FILE__, __LINE__);
-               g_ptr_array_free(contactsMemory, TRUE);
-               gtk_widget_hide(progressDialog.dialog);
-               return (-1);
-       }
-
+       pbEntry = g_malloc(sizeof(PhonebookEntry));
        pbEntry->entry = *entry;
 
        if (*pbEntry->entry.name == '\0' && *pbEntry->entry.number == '\0')
@@ -2286,13 +2280,7 @@ static gint InsertPBEntrySM(gn_phonebook_entry * entry)
 {
        PhonebookEntry *pbEntry;
 
-       if ((pbEntry = (PhonebookEntry *) g_malloc(sizeof(PhonebookEntry))) == 
NULL) {
-               g_print(_("Error: %s: line %d: Can't allocate memory!\n"), 
__FILE__, __LINE__);
-               g_ptr_array_free(contactsMemory, TRUE);
-               gtk_widget_hide(progressDialog.dialog);
-               return (-1);
-       }
-
+       pbEntry = g_malloc(sizeof(PhonebookEntry));
        pbEntry->entry = *entry;
 
        if (*pbEntry->entry.name == '\0' && *pbEntry->entry.number == '\0')
@@ -2951,11 +2939,7 @@ SelectContactData *GUI_SelectContactDialog(void)
                                        phoneMonitor.supported & 
PM_CALLERGROUP);
 
        for (i = 0; i < 4; i++) {
-               if ((sColumn = g_malloc(sizeof(SortColumn))) == NULL) {
-                       g_print(_("Error: %s: line %d: Can't allocate 
memory!\n"), __FILE__,
-                               __LINE__);
-                       return NULL;
-               }
+               sColumn = g_malloc(sizeof(SortColumn));
                sColumn->clist = selectContactData.clist;
                sColumn->column = i;
                
gtk_signal_connect(GTK_OBJECT(GTK_CLIST(selectContactData.clist)->column[i].button),
@@ -3197,11 +3181,7 @@ void GUI_CreateContactsWindow(void)
 //  gtk_clist_set_column_visibility (GTK_CLIST (clist), 3, 
phoneMonitor.supported & PM_CALLERGROUP);
 
        for (i = 0; i < 4; i++) {
-               if ((sColumn = g_malloc(sizeof(SortColumn))) == NULL) {
-                       g_print(_("Error: %s: line %d: Can't allocate 
memory!\n"), __FILE__,
-                               __LINE__);
-                       gtk_main_quit();
-               }
+               sColumn = g_malloc(sizeof(SortColumn));
                sColumn->clist = clist;
                sColumn->column = i;
                
gtk_signal_connect(GTK_OBJECT(GTK_CLIST(clist)->column[i].button), "clicked",
diff --git a/xgnokii/xgnokii_sms.c b/xgnokii/xgnokii_sms.c
index 3360c27..3606a10 100644
--- a/xgnokii/xgnokii_sms.c
+++ b/xgnokii/xgnokii_sms.c
@@ -1779,11 +1779,7 @@ void GUI_CreateSMSWindow(void)
        gtk_clist_set_column_justification (GTK_CLIST (SMS.smsClist), 2, 
GTK_JUSTIFY_CENTER);
        */
        for (i = 0; i < 4; i++) {
-               if ((sColumn = g_malloc(sizeof(SortColumn))) == NULL) {
-                       g_print(_("Error: %s: line %d: Can't allocate 
memory!\n"), __FILE__,
-                               __LINE__);
-                       gtk_main_quit();
-               }
+               sColumn = g_malloc(sizeof(SortColumn));
                sColumn->clist = SMS.smsClist;
                sColumn->column = i;
                
gtk_signal_connect(GTK_OBJECT(GTK_CLIST(SMS.smsClist)->column[i].button), 
"clicked",
diff --git a/xgnokii/xgnokii_speed.c b/xgnokii/xgnokii_speed.c
index ba508cf..a8cfa60 100644
--- a/xgnokii/xgnokii_speed.c
+++ b/xgnokii/xgnokii_speed.c
@@ -170,17 +170,10 @@ static void ReadSpeedDial(void)
        gtk_clist_clear(GTK_CLIST(clist));
 
        for (i = 2; i < 10; i++) {
-               if ((d = (D_SpeedDial *) g_malloc(sizeof(D_SpeedDial))) == 
NULL) {
-                       g_print(_("Error: %s: line %d: Can't allocate 
memory!\n"), __FILE__, __LINE__);
-                       return;
-               }
+               d = g_malloc(sizeof(D_SpeedDial));
                memset(d, 0, sizeof(D_SpeedDial));
                d->entry.number = i;
-               if ((e = (PhoneEvent *) g_malloc(sizeof(PhoneEvent))) == NULL) {
-                       g_print(_("Error: %s: line %d: Can't allocate 
memory!\n"), __FILE__, __LINE__);
-                       g_free(d);
-                       return;
-               }
+               e = g_malloc(sizeof(PhoneEvent));
                e->event = Event_GetSpeedDial;
                e->data = d;
                GUI_InsertEvent(e);
@@ -236,11 +229,7 @@ static void SaveSpeedDial(void)
                                gn_log_xdebug("location: %i\n", 
d->entry.location);
                                if (d->entry.location == 0)
                                        continue;
-                               if ((e = (PhoneEvent *) 
g_malloc(sizeof(PhoneEvent))) == NULL) {
-                                       g_print(_("Error: %s: line %d: Can't 
allocate memory!\n"), __FILE__, __LINE__);
-                                       return;
-                               }
-
+                               e = g_malloc(sizeof(PhoneEvent));
                                e->event = Event_SendSpeedDial;
                                e->data = d;
                                GUI_InsertEvent(e);
@@ -320,13 +309,7 @@ static void OkImportDialog(GtkWidget * w, GtkFileSelection 
* fs)
 
        i = 0;
        while (fgets(buf, IO_BUF_LEN, f) && i++ < 9) {
-               if ((d = (D_SpeedDial *) g_malloc(sizeof(D_SpeedDial))) == 
NULL) {
-                       g_print(_("Error: %s: line %d: Can't allocate 
memory!\n"), __FILE__, __LINE__);
-                       gtk_clist_clear(GTK_CLIST(clist));
-                       gtk_clist_sort(GTK_CLIST(clist));
-                       gtk_clist_thaw(GTK_CLIST(clist));
-                       return;
-               }
+               d = g_malloc(sizeof(D_SpeedDial));
                if (ParseLine(d, buf)) {
                        if (d->entry.number != i) {
                                g_free(d);
@@ -604,10 +587,7 @@ void GUI_CreateSpeedDialWindow(void)
 //  gtk_clist_set_column_visibility (GTK_CLIST (clist), 3, 
xgnokiiConfig.callerGroupsSupported);
 
        for (i = 0; i < 3; i++) {
-               if ((sColumn = g_malloc(sizeof(SortColumn))) == NULL) {
-                       g_print(_("Error: %s: line %d: Can't allocate 
memory!\n"), __FILE__, __LINE__);
-                       gtk_main_quit();
-               }
+               sColumn = g_malloc(sizeof(SortColumn));
                sColumn->clist = clist;
                sColumn->column = i;
                
gtk_signal_connect(GTK_OBJECT(GTK_CLIST(clist)->column[i].button), "clicked",

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

Summary of changes:
 xgnokii/xgnokii_calendar.c |    6 +-----
 xgnokii/xgnokii_cfg.c      |    6 +-----
 xgnokii/xgnokii_contacts.c |   28 ++++------------------------
 xgnokii/xgnokii_sms.c      |    6 +-----
 xgnokii/xgnokii_speed.c    |   30 +++++-------------------------
 5 files changed, 12 insertions(+), 64 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

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