Get rid of unused variables

This commit is contained in:
Andrew Pamment 2016-08-06 14:55:18 +10:00
parent 9bd090f1da
commit a286f6b73c
9 changed files with 18 additions and 66 deletions

4
bbs.c
View File

@ -308,8 +308,6 @@ void record_last10_callers(struct user_record *user) {
struct last10_callers callers[10]; struct last10_callers callers[10];
int i,j; int i,j;
char buffer[256];
struct tm l10_time;
FILE *fptr = fopen("last10.dat", "rb"); FILE *fptr = fopen("last10.dat", "rb");
if (fptr != NULL) { if (fptr != NULL) {
@ -346,7 +344,7 @@ void record_last10_callers(struct user_record *user) {
void display_last10_callers(struct user_record *user) { void display_last10_callers(struct user_record *user) {
struct last10_callers callers[10]; struct last10_callers callers[10];
int i,z,j; int i,z;
struct tm l10_time; struct tm l10_time;
FILE *fptr = fopen("last10.dat", "rb"); FILE *fptr = fopen("last10.dat", "rb");

View File

@ -99,21 +99,15 @@ void chat_system(struct user_record *user) {
char c; char c;
char buffer2[256]; char buffer2[256];
char buffer[513]; char buffer[513];
char buffer3[513];
char outputbuffer[513]; char outputbuffer[513];
int buffer_at = 0; int buffer_at = 0;
int do_update = 1; int do_update = 1;
int i; int i;
int o;
int l;
int j; int j;
int z;
int z2;
char *usr; char *usr;
char *cmd; char *cmd;
char *where; char *where;
char *message; char *message;
char *pos;
char *sep; char *sep;
char *target; char *target;
memset(inputbuffer, 0, 80); memset(inputbuffer, 0, 80);

View File

@ -134,7 +134,6 @@ void rundoor(struct user_record *user, char *cmd, int stdio) {
int ret; int ret;
char c; char c;
int len; int len;
int status;
int master; int master;
int slave; int slave;
fd_set fdset; fd_set fdset;

View File

@ -270,8 +270,6 @@ void list_emails(struct user_record *user) {
char *sql = "SELECT sender,subject,seen,date FROM email WHERE recipient LIKE ?"; char *sql = "SELECT sender,subject,seen,date FROM email WHERE recipient LIKE ?";
char *subject; char *subject;
char *from; char *from;
char *to;
char *body;
time_t date; time_t date;
int seen; int seen;
int msgid; int msgid;

20
files.c
View File

@ -15,8 +15,6 @@
extern struct bbs_config conf; extern struct bbs_config conf;
extern int gSocket; extern int gSocket;
static int doCancel = 0;
struct file_entry { struct file_entry {
char *filename; char *filename;
char *description; char *description;
@ -162,7 +160,6 @@ int doIO(ZModem *zm) {
void upload_zmodem(struct user_record *user) { void upload_zmodem(struct user_record *user) {
ZModem zm; ZModem zm;
int done;
upload_path = conf.file_directories[user->cur_file_dir]->file_subs[user->cur_file_sub]->upload_path; upload_path = conf.file_directories[user->cur_file_dir]->file_subs[user->cur_file_sub]->upload_path;
@ -179,7 +176,7 @@ void upload_zmodem(struct user_record *user) {
zm.packetsize = 1024; zm.packetsize = 1024;
done = ZmodemRInit(&zm); ZmodemRInit(&zm);
doIO(&zm); doIO(&zm);
} }
@ -264,15 +261,6 @@ void upload(struct user_record *user) {
void download_zmodem(struct user_record *user, char *filename) { void download_zmodem(struct user_record *user, char *filename) {
ZModem zm; ZModem zm;
int done ; int done ;
fd_set readfds;
struct timeval timeout;
int i;
int j;
int len;
int pos;
u_char buffer[2048];
u_char buffer2[1024];
dolog("Attempting to upload %s", filename); dolog("Attempting to upload %s", filename);
@ -337,10 +325,9 @@ void download(struct user_record *user) {
char *usql = "update files set dlcount=? where filename like ?"; char *usql = "update files set dlcount=? where filename like ?";
char buffer[256]; char buffer[256];
int dloads; int dloads;
char *err_msg = NULL;
sqlite3 *db; sqlite3 *db;
sqlite3_stmt *res; sqlite3_stmt *res;
int rc; int rc;
for (i=0;i<tagged_count;i++) { for (i=0;i<tagged_count;i++) {
download_zmodem(user, tagged_files[i]); download_zmodem(user, tagged_files[i]);
@ -407,7 +394,6 @@ void list_files(struct user_record *user) {
int file_size; int file_size;
char file_unit; char file_unit;
int lines = 0; int lines = 0;
char desc;
int i; int i;
int j; int j;
int z; int z;

View File

@ -266,7 +266,6 @@ char *external_editor(struct user_record *user, char *to, char *from, char *quot
FILE *fptr; FILE *fptr;
char *body = NULL; char *body = NULL;
char buffer[256]; char buffer[256];
char buffer2[256];
int len; int len;
int totlen; int totlen;
char *body2 = NULL; char *body2 = NULL;
@ -420,7 +419,6 @@ char *editor(struct user_record *user, char *quote, char *from, int email) {
int lines = 0; int lines = 0;
char buffer[256]; char buffer[256];
char linebuffer[80]; char linebuffer[80];
char prompt[12];
int doquit = 0; int doquit = 0;
char **content = NULL; char **content = NULL;
int i; int i;
@ -687,7 +685,6 @@ char *editor(struct user_record *user, char *quote, char *from, int email) {
void read_message(struct user_record *user, struct msg_headers *msghs, int mailno) { void read_message(struct user_record *user, struct msg_headers *msghs, int mailno) {
s_JamBase *jb; s_JamBase *jb;
s_JamBaseHeader jbh;
s_JamMsgHeader jmh; s_JamMsgHeader jmh;
s_JamSubPacket* jsp; s_JamSubPacket* jsp;
s_JamSubfield jsf; s_JamSubfield jsf;
@ -707,13 +704,8 @@ void read_message(struct user_record *user, struct msg_headers *msghs, int mailn
char c; char c;
char *replybody; char *replybody;
struct fido_addr *from_addr = NULL; struct fido_addr *from_addr = NULL;
struct fido_addr *dest;
int wwiv_to = 0;
int i, j; int i, j;
char *wwiv_addressee;
char *dest_addr; char *dest_addr;
int to_us;
char *msgid = NULL;
char timestr[17]; char timestr[17];
int doquit = 0; int doquit = 0;
int skip_line = 0; int skip_line = 0;
@ -1191,7 +1183,6 @@ int mail_menu(struct user_record *user) {
int doquit = 0; int doquit = 0;
int domail = 0; int domail = 0;
char c; char c;
char prompt[128];
char buffer[256]; char buffer[256];
char buffer2[256]; char buffer2[256];
int i; int i;
@ -1201,7 +1192,6 @@ int mail_menu(struct user_record *user) {
struct msg_headers *msghs; struct msg_headers *msghs;
s_JamBase *jb; s_JamBase *jb;
s_JamBaseHeader jbh;
s_JamMsgHeader jmh; s_JamMsgHeader jmh;
s_JamSubPacket* jsp; s_JamSubPacket* jsp;
s_JamSubfield jsf; s_JamSubfield jsf;
@ -1212,19 +1202,10 @@ int mail_menu(struct user_record *user) {
char *subject; char *subject;
char *from; char *from;
char *to; char *to;
char *body;
char *replybody;
char *wwiv_addressee;
char timestr[17]; char timestr[17];
char *msg; char *msg;
int closed; int closed;
uint32_t jam_crc;
unsigned int lastmsg,currmsg;
int lines;
struct fido_addr *from_addr = NULL; struct fido_addr *from_addr = NULL;
struct fido_addr *dest = NULL;
char *dest_addr;
int to_us;
int wwiv_to; int wwiv_to;
struct stat s; struct stat s;
int do_internal_menu = 0; int do_internal_menu = 0;
@ -1818,8 +1799,6 @@ void mail_scan(struct user_record *user) {
char c; char c;
int i; int i;
int j; int j;
char buffer[256];
int count;
s_printf("\r\nScan for new mail? (Y/N) : "); s_printf("\r\nScan for new mail? (Y/N) : ");
c = s_getc(); c = s_getc();

2
main.c
View File

@ -321,7 +321,7 @@ static int handler(void* user, const char* section, const char* name,
void server(int port) { void server(int port) {
struct sigaction sa; struct sigaction sa;
struct sigaction st; struct sigaction st;
int socket_desc, client_sock, c, *new_sock; int socket_desc, client_sock, c;
int pid; int pid;
struct sockaddr_in server, client; struct sockaddr_in server, client;

View File

@ -13,7 +13,6 @@ extern struct bbs_config conf;
void main_menu(struct user_record *user) { void main_menu(struct user_record *user) {
int doquit = 0; int doquit = 0;
char c; char c;
char prompt[128];
char buffer[256]; char buffer[256];
int i; int i;
struct stat s; struct stat s;

View File

@ -82,7 +82,6 @@ int save_user(struct user_record *user) {
char *update_sql = "UPDATE users SET password=?, salt=?, firstname=?," char *update_sql = "UPDATE users SET password=?, salt=?, firstname=?,"
"lastname=?, email=?, location=?, sec_level=?, last_on=?, time_left=?, cur_mail_conf=?, cur_mail_area=?, cur_file_dir=?, cur_file_sub=?, times_on=? where loginname LIKE ?"; "lastname=?, email=?, location=?, sec_level=?, last_on=?, time_left=?, cur_mail_conf=?, cur_mail_area=?, cur_file_dir=?, cur_file_sub=?, times_on=? where loginname LIKE ?";
char *err_msg = 0;
sprintf(buffer, "%s/users.sq3", conf.bbs_path); sprintf(buffer, "%s/users.sq3", conf.bbs_path);