Ignore:
Timestamp:
Apr 3, 2008, 12:08:14 PM (16 years ago)
Author:
Bruno Cornec
Message:
  • Removes the useless uid field of the mountlist_line struct
  • Removes some \r found useless
  • Adds conditions of existence around button updates with Newt (valgrind feedback)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.6/mondo/src/common/newt-specific.c

    r1878 r1899  
    221221                system("sync");
    222222                printf
    223                     ("---promptdialogYN---1--- %s\r\n---promptdialogYN---Q--- [yes] [no] ---\r\n--> ",
     223                    ("---promptdialogYN---1--- %s\n---promptdialogYN---Q--- [yes] [no] ---\n--> ",
    224224                     prompt);
    225225                (void) fgets(tmp, MAX_NEWT_COMMENT_LEN, stdin);
     
    267267            system("sync");
    268268            printf
    269                 ("---promptdialogOKC---1--- %s\r\n---promptdialogOKC---Q--- [OK] [Cancel] ---\r\n--> ",
     269                ("---promptdialogOKC---1--- %s\n---promptdialogOKC---Q--- [OK] [Cancel] ---\n--> ",
    270270                 prompt);
    271271            (void) fgets(tmp, MAX_NEWT_COMMENT_LEN, stdin);
     
    791791        if (g_text_mode) {
    792792            printf
    793                 ("---promptpopup---1--- %s\r\n---promptpopup---Q--- [OK] ---\r\n--> ",
     793                ("---promptpopup---1--- %s\n---promptpopup---Q--- [OK] ---\n--> ",
    794794                 prompt);
    795795            while (((ch = getchar()) != '\n') && (ch != EOF));
     
    833833        if (g_text_mode) {
    834834            printf
    835                 ("---promptstring---1--- %s\r\n---promptstring---2--- %s\r\n---promptstring---Q---\r\n-->  ",
     835                ("---promptstring---1--- %s\n---promptstring---2--- %s\n---promptstring---Q---\n-->  ",
    836836                 title, b);
    837837            (void) fgets(output, maxsize, stdin);
     
    10811081        }
    10821082        if (!g_text_mode) {
    1083             newtLabelSetText(g_isoform_header, g_isoform_header_str);
     1083            if (g_isoform_header) {
     1084                newtLabelSetText(g_isoform_header, g_isoform_header_str);
     1085            }
    10841086        }
    10851087        g_mysterious_dot_counter = (g_mysterious_dot_counter + 1) % 27;
     
    11171119                            "] %3d%% done; %2ld:%02ld to go", percentage,
    11181120                            time_remaining / 60, time_remaining % 60);
    1119                     printf("---evalcall---1--- %s\r\n",
     1121                    printf("---evalcall---1--- %s\n",
    11201122                           g_isoform_header_str);
    1121                     printf("---evalcall---2--- %s\r\n", taskprogress);
    1122                     printf("---evalcall---E---\r\n");
     1123                    printf("---evalcall---2--- %s\n", taskprogress);
     1124                    printf("---evalcall---E---\n");
    11231125                }
    11241126            } else {
    11251127                newtScaleSet(g_isoform_scale,
    11261128                             (unsigned long long) percentage);
    1127                 newtLabelSetText(g_isoform_pcline, pcline_str);
    1128                 if (percentage >= 3) {
     1129                if (g_isoform_pcline) {
     1130                    newtLabelSetText(g_isoform_pcline, pcline_str);
     1131                }
     1132                if ((percentage >= 3) && (g_isoform_timeline)) {
    11291133                    newtLabelSetText(g_isoform_timeline, timeline_str);
    11301134                }
     
    12481252
    12491253        if (g_text_mode) {
    1250             printf("---progress-form---1--- %s\r\n", blurb1);
    1251             printf("---progress-form---2--- %s\r\n", blurb2);
    1252             printf("---progress-form---3--- %s\r\n", blurb3);
     1254            printf("---progress-form---1--- %s\n", blurb1);
     1255            printf("---progress-form---2--- %s\n", blurb2);
     1256            printf("---progress-form---3--- %s\n", blurb3);
    12531257            printf("---progress-form---E---\n");
    12541258            sprintf(taskprogress, "TASK:  [");
     
    12671271                    " done; %2ld:%02ld to go",
    12681272                    time_remaining / 60, time_remaining % 60);
    1269             printf("---progress-form---4--- %s\r\n", taskprogress);
     1273            printf("---progress-form---4--- %s\n", taskprogress);
    12701274        } else {
    12711275            center_string(blurb1, 54);
    12721276            center_string(blurb2, 54);
    12731277            center_string(blurb3, 54);
    1274             newtLabelSetText(g_blurb1, blurb1);
    1275             newtLabelSetText(g_blurb2, blurb3);
    1276             newtLabelSetText(g_blurb3, blurb2);
     1278            if (g_blurb1) {
     1279                newtLabelSetText(g_blurb1, blurb1);
     1280            }
     1281            if (g_blurb2) {
     1282                newtLabelSetText(g_blurb2, blurb3);
     1283            }
     1284            if (g_blurb3) {
     1285                newtLabelSetText(g_blurb3, blurb2);
     1286            }
    12771287            newtScaleSet(g_scale, (unsigned long long) g_current_progress);
    1278             if (percentage >= 2) {
     1288            if ((percentage >= 2) && (g_timeline)) {
    12791289                newtLabelSetText(g_timeline, timeline_str);
    12801290            }
    1281             newtLabelSetText(g_percentline, percentline_str);
     1291            if (g_percentline) {
     1292                newtLabelSetText(g_percentline, percentline_str);
     1293            }
    12821294            newtRefresh();
    12831295        }
Note: See TracChangeset for help on using the changeset viewer.