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

6
bbs.c
View File

@ -308,9 +308,7 @@ void record_last10_callers(struct user_record *user) {
struct last10_callers callers[10];
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) {
for (i=0;i<10;i++) {
@ -346,7 +344,7 @@ void record_last10_callers(struct user_record *user) {
void display_last10_callers(struct user_record *user) {
struct last10_callers callers[10];
int i,z,j;
int i,z;
struct tm l10_time;
FILE *fptr = fopen("last10.dat", "rb");

View File

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

View File

@ -134,7 +134,6 @@ void rundoor(struct user_record *user, char *cmd, int stdio) {
int ret;
char c;
int len;
int status;
int master;
int slave;
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 *subject;
char *from;
char *to;
char *body;
time_t date;
int seen;
int msgid;

20
files.c
View File

@ -15,8 +15,6 @@
extern struct bbs_config conf;
extern int gSocket;
static int doCancel = 0;
struct file_entry {
char *filename;
char *description;
@ -162,7 +160,6 @@ int doIO(ZModem *zm) {
void upload_zmodem(struct user_record *user) {
ZModem zm;
int done;
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;
done = ZmodemRInit(&zm);
ZmodemRInit(&zm);
doIO(&zm);
}
@ -264,15 +261,6 @@ void upload(struct user_record *user) {
void download_zmodem(struct user_record *user, char *filename) {
ZModem zm;
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);
@ -337,10 +325,9 @@ void download(struct user_record *user) {
char *usql = "update files set dlcount=? where filename like ?";
char buffer[256];
int dloads;
char *err_msg = NULL;
sqlite3 *db;
sqlite3_stmt *res;
int rc;
sqlite3_stmt *res;
int rc;
for (i=0;i<tagged_count;i++) {
download_zmodem(user, tagged_files[i]);
@ -407,7 +394,6 @@ void list_files(struct user_record *user) {
int file_size;
char file_unit;
int lines = 0;
char desc;
int i;
int j;
int z;

View File

@ -266,8 +266,7 @@ char *external_editor(struct user_record *user, char *to, char *from, char *quot
FILE *fptr;
char *body = NULL;
char buffer[256];
char buffer2[256];
int len;
int len;
int totlen;
char *body2 = NULL;
char *tagline;
@ -420,8 +419,7 @@ char *editor(struct user_record *user, char *quote, char *from, int email) {
int lines = 0;
char buffer[256];
char linebuffer[80];
char prompt[12];
int doquit = 0;
int doquit = 0;
char **content = NULL;
int i;
char *msg;
@ -687,8 +685,7 @@ 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) {
s_JamBase *jb;
s_JamBaseHeader jbh;
s_JamMsgHeader jmh;
s_JamMsgHeader jmh;
s_JamSubPacket* jsp;
s_JamSubfield jsf;
s_JamLastRead jlr;
@ -707,14 +704,9 @@ void read_message(struct user_record *user, struct msg_headers *msghs, int mailn
char c;
char *replybody;
struct fido_addr *from_addr = NULL;
struct fido_addr *dest;
int wwiv_to = 0;
int i, j;
char *wwiv_addressee;
char *dest_addr;
int to_us;
char *msgid = NULL;
char timestr[17];
int i, j;
char *dest_addr;
char timestr[17];
int doquit = 0;
int skip_line = 0;
int chars = 0;
@ -1191,8 +1183,7 @@ int mail_menu(struct user_record *user) {
int doquit = 0;
int domail = 0;
char c;
char prompt[128];
char buffer[256];
char buffer[256];
char buffer2[256];
int i;
int j;
@ -1201,8 +1192,7 @@ int mail_menu(struct user_record *user) {
struct msg_headers *msghs;
s_JamBase *jb;
s_JamBaseHeader jbh;
s_JamMsgHeader jmh;
s_JamMsgHeader jmh;
s_JamSubPacket* jsp;
s_JamSubfield jsf;
s_JamLastRead jlr;
@ -1212,20 +1202,11 @@ int mail_menu(struct user_record *user) {
char *subject;
char *from;
char *to;
char *body;
char *replybody;
char *wwiv_addressee;
char timestr[17];
char timestr[17];
char *msg;
int closed;
uint32_t jam_crc;
unsigned int lastmsg,currmsg;
int lines;
struct fido_addr *from_addr = NULL;
struct fido_addr *dest = NULL;
char *dest_addr;
int to_us;
int wwiv_to;
struct fido_addr *from_addr = NULL;
int wwiv_to;
struct stat s;
int do_internal_menu = 0;
char *lRet;
@ -1818,9 +1799,7 @@ void mail_scan(struct user_record *user) {
char c;
int i;
int j;
char buffer[256];
int count;
s_printf("\r\nScan for new mail? (Y/N) : ");
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) {
struct sigaction sa;
struct sigaction st;
int socket_desc, client_sock, c, *new_sock;
int socket_desc, client_sock, c;
int pid;
struct sockaddr_in server, client;

View File

@ -13,7 +13,6 @@ extern struct bbs_config conf;
void main_menu(struct user_record *user) {
int doquit = 0;
char c;
char prompt[128];
char buffer[256];
int i;
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=?,"
"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);