File: 0006-Fix-modern-C-usage.patch

package info (click to toggle)
bibcursed 2.0.1-0.2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 440 kB
  • sloc: ansic: 7,605; makefile: 9
file content (167 lines) | stat: -rw-r--r-- 3,293 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
From: Boyuan Yang <byang@debian.org>
Date: Thu, 11 Jul 2024 16:28:43 -0400
Subject: Fix modern C usage

Bug-Debian: https://bugs.debian.org/1066309
Forwarded: no
---
 bibcursed.c | 43 ++++++++++++++++++++++++++++++-------------
 1 file changed, 30 insertions(+), 13 deletions(-)

diff --git a/bibcursed.c b/bibcursed.c
index ae8173f..6a91434 100644
--- a/bibcursed.c
+++ b/bibcursed.c
@@ -33,6 +33,17 @@ char bibfile[100];
 void add_bold(char letter);
 void general_help();
 
+int search_menu();
+int add_entry();
+void delete_entry();
+int change_entry();
+void config_options();
+void help();
+void quit_prog();
+int field_menu(int priority, int field_set, char *fieldname);
+int change_field(char *entry_name);
+
+
 void setup_screen()
  {
    clear();
@@ -91,7 +102,7 @@ void menu()
  }
 
 
-help()
+void help()
  {
    char tmp_char, lch;
 
@@ -140,12 +151,12 @@ void general_help()
  }
 
 
-config_options()
+void config_options()
  {
    /* For future use */
  }
 
-add_entry()
+int add_entry()
  {
    char ch, lch, entry_type, length;
    int use_author = 0, use_title = 0, use_journal = 0, use_year = 0;
@@ -268,7 +279,7 @@ add_entry()
       move(4,5);
       printw("%s","Fields marked with a  *  have been set. Press Z when done or");
       move(5,5); printw("%s","Q to quit");
-                
+
       if (use_address != 0)
        {
          move(print_pos,5);
@@ -419,7 +430,7 @@ add_entry()
       cbreak();
       ch = getch();
       lch = tolower(ch);
-    
+
       if (lch == 'q') return(0);
 
       setup_screen();
@@ -629,7 +640,7 @@ add_entry()
              key_name = (strchr(str2,'{')+1);
          else
              key_name = (strchr(str2,'(')+1);
-          
+
          length = strlen(key_name);
          *(key_name + (length-2)) = 0;
 
@@ -852,10 +863,11 @@ add_entry()
    cbreak();
    ch = getch();
 
+   return(0);
  }
 
 
-delete_entry()
+void delete_entry()
  {
    char entry_name[100], str[100], str2[100], out_string[100], ch;
    char *key_name;
@@ -939,6 +951,8 @@ delete_entry()
       strcat(out_string, bibfile);
       system(out_string);
     }
+
+  return;
  }
 
 
@@ -961,7 +975,7 @@ int field_menu(int priority, int field_set, char *fieldname)
  }
 
 
-change_entry()
+int change_entry()
  {
    char entry_name[100], str[100], ch, lch;
    int record_found = 0, found_record = 0, print_pos = 6, record_count = 0;
@@ -1032,10 +1046,11 @@ change_entry()
    if (lch == 'c')
       change_field(entry_name);
 
+   return(0);
  }
 
 
-change_field(char *entry_name)
+int change_field(char *entry_name)
  {
    char ch, lch;
    char *field_name, *lfield_name, *key_name;
@@ -1186,7 +1201,7 @@ change_field(char *entry_name)
  }
 
 
-search_file(int what)
+void search_file(int what)
  {
    /* Search the file using the supplied option */
    char search_term[100];
@@ -1317,7 +1332,7 @@ void add_bold(char letter)
  }
 
 
-search_menu()
+int search_menu()
  {
    /* Display the first search menu */
    int ch, lch, type;
@@ -1378,17 +1393,19 @@ search_menu()
       case 'q' : return(0); break;
       default : menu(); break ;
     }
+
+    return(0);
  }
 
 
-quit_prog()
+void quit_prog()
  {
    endwin();
    exit(0);
  }
 
 
-main(int argc, char *argv[])
+int main(int argc, char *argv[])
  {
    int ch, i;
    char str[100];