Change BX_add_to_screen() and BX_skip_incoming_mirc() to use char * rather than unsigned char * arguments.
This clears up a few pointer type mismatch warnings. git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@477 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
@@ -251,7 +251,6 @@ extern Function_ptr *global;
|
||||
#define put_it (*(void (*)(const char *, ...))global[PUT_IT])
|
||||
#define bitchsay (*(void (*)(const char *, ...))global[BITCHSAY])
|
||||
#define yell (*(void (*)(const char *, ...))global[YELL])
|
||||
#define add_to_screen (*(void (*)(unsigned char *))global[ADD_TO_SCREEN])
|
||||
#define add_to_log (*(void (*)(FILE *, time_t, const char *, int ))global[ADD_TO_LOG])
|
||||
|
||||
#define bsd_glob (*(int (*)(const char *, int, int (*)(const char *, int), glob_t *))global[BSD_GLOB])
|
||||
@@ -278,8 +277,8 @@ extern Function_ptr *global;
|
||||
/* screen.c */
|
||||
#define prepare_display (*(unsigned char **(*)(const unsigned char *, int , int *, int ))global[PREPARE_DISPLAY])
|
||||
#define add_to_window (*(void (*)(Window *, const unsigned char *))global[ADD_TO_WINDOW])
|
||||
#define skip_incoming_mirc (*(unsigned char *(*)(unsigned char *))global[SKIP_INCOMING_MIRC])
|
||||
#define add_to_screen (*(void (*)(unsigned char *))global[ADD_TO_SCREEN])
|
||||
#define skip_incoming_mirc (*(char *(*)(char *))global[SKIP_INCOMING_MIRC])
|
||||
#define add_to_screen (*(void (*)(char *))global[ADD_TO_SCREEN])
|
||||
#define split_up_line (*(unsigned char **(*)(const unsigned char *, int ))global[SPLIT_UP_LINE])
|
||||
#define output_line (*(int (*)(const unsigned char *))global[OUTPUT_LINE])
|
||||
#define output_with_count (*(int (*)(const unsigned char *, int , int ))global[OUTPUT_WITH_COUNT])
|
||||
|
||||
@@ -48,7 +48,7 @@ RETSIGTYPE sig_refresh_screen (int);
|
||||
ShrinkInfo resize_display (Window *);
|
||||
void redraw_window (Window *, int);
|
||||
void redraw_all_windows (void);
|
||||
void BX_add_to_screen (unsigned char *);
|
||||
void BX_add_to_screen (char *);
|
||||
void do_screens (fd_set *);
|
||||
unsigned char **BX_split_up_line(const unsigned char *, int);
|
||||
void BX_xterm_settitle(void);
|
||||
@@ -65,8 +65,7 @@ Screen * BX_create_new_screen(void);
|
||||
const u_char *BX_skip_ctl_c_seq (const u_char *, int *, int *, int);
|
||||
u_char **BX_prepare_display (const u_char *, int, int *, int);
|
||||
int BX_output_with_count (const unsigned char *, int, int);
|
||||
unsigned char *BX_skip_incoming_mirc (unsigned char *);
|
||||
void delchar(unsigned char **text, int cnum);
|
||||
char *BX_skip_incoming_mirc (char *);
|
||||
|
||||
/* Dont do any word-wrapping, just truncate each line at its place. */
|
||||
#define PREPARE_NOWRAP 0x01
|
||||
|
||||
@@ -91,20 +91,35 @@ static void put_color (int, int);
|
||||
|
||||
const u_char *BX_skip_ctl_c_seq (const u_char *start, int *lhs, int *rhs, int proper);
|
||||
|
||||
static void delchar(char **text, int cnum)
|
||||
{
|
||||
int i;
|
||||
|
||||
unsigned char *BX_skip_incoming_mirc(unsigned char *text)
|
||||
for (i = 0; i < strlen(*text) - 1; i++)
|
||||
if (i >= cnum) text[0][i] = text[0][i+1];
|
||||
|
||||
text[0][i] = 0;
|
||||
}
|
||||
|
||||
char *BX_skip_incoming_mirc(char *text)
|
||||
{
|
||||
int i, x;
|
||||
for (i=0;i<strlen(text);i++) {
|
||||
if ((int)text[i] != 3) continue;
|
||||
else {
|
||||
|
||||
for (i = 0; i < strlen(text); i++) {
|
||||
if (text[i] == 3)
|
||||
{
|
||||
x = 0;
|
||||
while (((isdigit(text[i])) || ((int)text[i] == 3))) {
|
||||
while((int)text[i] == 3) delchar(&text, i);
|
||||
while((isdigit(text[i])) && (x<2)) {
|
||||
while (isdigit((unsigned char)text[i]) || text[i] == 3)
|
||||
{
|
||||
while (text[i] == 3)
|
||||
delchar(&text, i);
|
||||
if (isdigit(text[i])) {
|
||||
delchar(&text, i); x += 2;
|
||||
while (isdigit((unsigned char)text[i]) && x < 2)
|
||||
{
|
||||
delchar(&text, i);
|
||||
if (isdigit((unsigned char)text[i]))
|
||||
{
|
||||
delchar(&text, i);
|
||||
x += 2;
|
||||
} else x += 1;
|
||||
}
|
||||
if (text[i] != ',') break;
|
||||
@@ -116,30 +131,20 @@ unsigned char *BX_skip_incoming_mirc(unsigned char *text)
|
||||
return text;
|
||||
}
|
||||
|
||||
void delchar(unsigned char **text, int cnum)
|
||||
{
|
||||
int i;
|
||||
for (i=0;i<strlen(*text)-1;i++)
|
||||
if (i >= cnum) text[0][i] = text[0][i+1];
|
||||
|
||||
text[0][i] = 0;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* add_to_screen: This adds the given null terminated buffer to the screen.
|
||||
* That is, it determines which window the information should go to, which
|
||||
* lastlog the information should be added to, which log the information
|
||||
* should be sent to, etc
|
||||
*/
|
||||
void BX_add_to_screen(unsigned char *buffer)
|
||||
void BX_add_to_screen(char *buffer)
|
||||
{
|
||||
char *out = NULL;
|
||||
if (!get_int_var(MIRCS_VAR))
|
||||
buffer = skip_incoming_mirc(buffer);
|
||||
char *out;
|
||||
|
||||
|
||||
out = buffer;
|
||||
if (!get_int_var(MIRCS_VAR))
|
||||
out = skip_incoming_mirc(buffer);
|
||||
else
|
||||
out = buffer;
|
||||
|
||||
if (in_window_command)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user