Parcourir la source

* More fixes

svn: 1314
Bryan Drewery il y a 22 ans
Parent
commit
8f3c03507d

+ 2 - 2
src/compat/memutil.c

@@ -3,8 +3,8 @@
 #include "memcpy.h"
 #include "src/main.h"
 
-extern "C" void * __real_malloc(size_t);
-extern "C" void * __real_realloc(void *, size_t);
+extern void * __real_malloc(size_t);
+extern void * __real_realloc(void *, size_t);
 
 void *
 __wrap_malloc(size_t size)

+ 3 - 11
src/compat/memutil.h

@@ -7,18 +7,10 @@
 #undef str_redup
 #undef strdup
 
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void *malloc(size_t) __THROW __attribute_malloc__;
-void *realloc(void *, size_t) __THROW __attribute_malloc__;
-void *calloc(size_t, size_t) __THROW __attribute_malloc__;
+void *malloc(size_t);
+void *realloc(void *, size_t);
+void *calloc(size_t, size_t);
 void str_redup(char **, const char *);
 char *strdup(const char *);
 
-#ifdef __cplusplus
-}
-#endif
-
 #endif /* !_MEMUTIL_H */

+ 1 - 1
src/mod/channels.mod/channels.c

@@ -758,7 +758,7 @@ static int channels_chon(char *handle, int idx)
 
 static cmd_t my_chon[] =
 {
-  {"*",		"",	(Function) channels_chon,	"channels:chon"},
+  {"*",		"",	channels_chon,	"channels:chon"},
   {NULL,	NULL,	NULL,				NULL}
 };
 

+ 16 - 16
src/mod/channels.mod/cmdschan.c

@@ -171,14 +171,14 @@ static void cmd_pls_invite(int idx, char *par)
   cmd_pls_mask('I', idx, par);
 }
 
-static void cmd_mns_mask(char type, int idx, char *par)
+static void cmd_mns_mask(const char type, int idx, char *par)
 {
   int i = 0, j;
   struct chanset_t *chan = NULL;
-  char s[UHOSTLEN] = "", *who = NULL, *chname = NULL, *cmd = NULL, *mask = NULL;
+  char s[UHOSTLEN] = "", *who = NULL, *chname = NULL, *mask = NULL;
+  const char *cmd = (type == 'b' ? "ban" : type == 'e' ? "exempt" : "invite");
   masklist *m = NULL;
 
-  cmd = type == 'b' ? "ban" : type == 'e' ? "exempt" : "invite";
   if (!par[0]) {
     dprintf(idx, "Usage: -%s <hostmask> [channel]\n", cmd);
     return;
@@ -350,7 +350,7 @@ static void cmd_info(int idx, char *par)
     dprintf(idx, "Info storage is turned off.\n");
     return;
   }
-  s1 = get_user(&USERENTRY_INFO, dcc[idx].user);
+  s1 = (char *) get_user(&USERENTRY_INFO, dcc[idx].user);
   if (s1 && s1[0] == '@')
     locked = 1;
   if (par[0] && strchr(CHANMETA, par[0])) {
@@ -1362,29 +1362,29 @@ static void cmd_chanset(int idx, char *par)
 static cmd_t C_dcc_irc[] =
 {
   {"+ban",	"o|o",	(Function) cmd_pls_ban,		NULL},
-  {"+exempt",	"o|o",	(Function) cmd_pls_exempt,	NULL},
-  {"+invite",	"o|o",	(Function) cmd_pls_invite,	NULL},
-  {"+chan",	"n",	(Function) cmd_pls_chan,	NULL},
-  {"+chrec",	"m|m",	(Function) cmd_pls_chrec,	NULL},
+  {"+exempt",	"o|o",	(Function) cmd_pls_exempt,		NULL},
+  {"+invite",	"o|o",	(Function) cmd_pls_invite,		NULL},
+  {"+chan",	"n",	(Function) cmd_pls_chan,		NULL},
+  {"+chrec",	"m|m",	(Function) cmd_pls_chrec,		NULL},
   {"-ban",	"o|o",	(Function) cmd_mns_ban,		NULL},
-  {"-chan",	"n",	(Function) cmd_mns_chan,	NULL},
-  {"-chrec",	"m|m",	(Function) cmd_mns_chrec,	NULL},
-  {"-exempt",	"o|o",	(Function) cmd_mns_exempt,	NULL},
-  {"-invite",	"o|o",	(Function) cmd_mns_invite,	NULL},
+  {"-chan",	"n",	(Function) cmd_mns_chan,		NULL},
+  {"-chrec",	"m|m",	(Function) cmd_mns_chrec,		NULL},
+  {"-exempt",	"o|o",	(Function) cmd_mns_exempt,		NULL},
+  {"-invite",	"o|o",	(Function) cmd_mns_invite,		NULL},
   {"bans",	"o|o",	(Function) cmd_bans,		NULL},
   {"botjoin",	"n",	(Function) cmd_botjoin,		NULL},
   {"botpart",	"n",	(Function) cmd_botpart,		NULL},
   {"exempts",	"o|o",	(Function) cmd_exempts,		NULL},
   {"invites",	"o|o",	(Function) cmd_invites,		NULL},
-  {"chaninfo",	"m|m",	(Function) cmd_chaninfo,	NULL},
+  {"chaninfo",	"m|m",	(Function) cmd_chaninfo,		NULL},
   {"chanset",	"m|m",	(Function) cmd_chanset,		NULL},
   {"chinfo",	"m|m",	(Function) cmd_chinfo,		NULL},
   {"cycle", 	"n|n",	(Function) cmd_cycle,		NULL},
   {"down",	"n|n",	(Function) cmd_down,		NULL},
   {"info",	"",	(Function) cmd_info,		NULL},
-  {"slowjoin",  "n",    (Function) cmd_slowjoin,        NULL},
-  {"slowpart",  "n|n",  (Function) cmd_slowpart,        NULL},
+  {"slowjoin",  "n",    (Function) cmd_slowjoin,		NULL},
+  {"slowpart",  "n|n",  (Function) cmd_slowpart,  		NULL},
   {"stick",	"o|o",	(Function) cmd_stick,		NULL},
   {"unstick",	"o|o",	(Function) cmd_unstick,		NULL},
-  {NULL,	NULL,	NULL,				NULL}
+  {NULL,	NULL,	NULL,			NULL}
 };

+ 1 - 1
src/mod/console.mod/console.c

@@ -112,7 +112,7 @@ console_set(struct userrec *u, struct user_entry *e, void *buf)
       free(ci->channel);
       free(ci);
     }
-    ci = (struct console_info *) e->u.extra = (struct console_info *) buf;
+    ci = e->u.extra = (struct console_info *) buf;
   }
 
   if (!noshare && !u->bot) {

+ 1 - 1
src/users.c

@@ -482,7 +482,7 @@ tell_user(int idx, struct userrec *u)
     fr.match = FR_CHAN | FR_GLOBAL;
     chan = findchan_by_dname(ch->channel);
     get_user_flagrec(dcc[idx].user, &fr, ch->channel);
-    if (!channel_privchan(chan) || (channel_private(chan) && (chan_op(fr) || glob_owner(fr)))) {
+    if (!channel_privchan(chan) || (channel_privchan(chan) && (chan_op(fr) || glob_owner(fr)))) {
       if (glob_op(fr) || chan_op(fr)) {
         if (ch->laston == 0L)
   	  strcpy(s1, "never");