Skip to content

Commit

Permalink
Split up declarations for adding const qualifiers for char * and void *.
Browse files Browse the repository at this point in the history
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Loading branch information
andersk committed Aug 15, 2009
1 parent c529ac8 commit 65b2173
Show file tree
Hide file tree
Showing 16 changed files with 52 additions and 26 deletions.
6 changes: 4 additions & 2 deletions cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ int owl_cmd_is_context_valid(owl_cmd *cmd, owl_context *ctx) {
char *owl_cmd_execute(owl_cmd *cmd, owl_cmddict *cd, owl_context *ctx, int argc, char **argv, char *cmdbuff) {
static int alias_recurse_depth = 0;
int ival=0;
char *cmdbuffargs, *newcmd, *rv=NULL;
char *cmdbuffargs;
char *newcmd, *rv=NULL;

if (argc < 1) return(NULL);

Expand Down Expand Up @@ -254,7 +255,8 @@ char *owl_cmd_describe(owl_cmd *cmd) {


void owl_cmd_get_help(owl_cmddict *d, char *name, owl_fmtext *fm) {
char *indent, *s;
char *s;
char *indent;
owl_cmd *cmd;

if (!name || (cmd = owl_dict_find_element(d, name)) == NULL) {
Expand Down
3 changes: 2 additions & 1 deletion commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -1885,7 +1885,8 @@ char *owl_command_zwrite(int argc, char **argv, char *buff)

char *owl_command_aimwrite(int argc, char **argv, char *buff)
{
char *newbuff, *recip, **myargv;
char *newbuff, *recip;
char **myargv;
int i, j, myargc;
owl_message *m;

Expand Down
3 changes: 2 additions & 1 deletion editwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,8 @@ void owl_editwin_delete_char(owl_editwin *e)
*/
void owl_editwin_transpose_chars(owl_editwin *e)
{
char *middle, *end, *start, *tmp;
char *middle, *end, *start;
char *tmp;

if (e->bufflen == 0) return;

Expand Down
3 changes: 2 additions & 1 deletion filterelement.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ static int owl_filterelement_match_filter(owl_filterelement *fe, owl_message *m)

static int owl_filterelement_match_perl(owl_filterelement *fe, owl_message *m)
{
char *subname, *perlrv;
char *subname;
char *perlrv;
int tf=0;

subname = fe->field;
Expand Down
3 changes: 2 additions & 1 deletion fmtext.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,8 @@ int owl_fmtext_search(owl_fmtext *f, owl_regex *re)
void owl_fmtext_append_ztext(owl_fmtext *f, char *text)
{
int stacksize, curattrs, curcolor;
char *ptr, *txtptr, *buff, *tmpptr;
char *ptr, *txtptr, *tmpptr;
char *buff;
int attrstack[32], chrstack[32], colorstack[32];

curattrs=OWL_FMTEXT_ATTR_NONE;
Expand Down
18 changes: 12 additions & 6 deletions functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ void owl_function_show_styles() {
}

char *owl_function_style_describe(char *name) {
char *desc, *s;
char *desc;
char *s;
owl_style *style;
style = owl_global_get_style_by_name(&g, name);
if (style) {
Expand Down Expand Up @@ -499,7 +500,8 @@ void owl_callback_aimwrite(owl_editwin *e) {
void owl_function_aimwrite(char *line, char *msg)
{
int ret;
char *to, *format_msg;
char *to;
char *format_msg;
owl_message *m;

to = line + 9;
Expand Down Expand Up @@ -881,7 +883,8 @@ void owl_function_unsuball()
void owl_function_loadsubs(char *file)
{
int ret, ret2;
char *foo, *path;
char *foo;
char *path;

if (file==NULL) {
ret=owl_zephyr_loadsubs(NULL, 0);
Expand Down Expand Up @@ -2015,7 +2018,8 @@ char *owl_function_exec(int argc, char **argv, char *buff, int type)
* if type == 0 return output
* else display in a popup
*/
char *newbuff, *redirect = " 2>&1 < /dev/null";
char *redirect = " 2>&1 < /dev/null";
char *newbuff;
char *out, buff2[1024];
int size;
FILE *p;
Expand Down Expand Up @@ -2648,7 +2652,8 @@ void owl_function_smartzpunt(int type)
* If type=0, uses just class. If type=1, uses instance as well. */
owl_view *v;
owl_message *m;
char *cmd, *cmdprefix, *mclass, *minst;
char *cmdprefix, *mclass, *minst;
char *cmd;

v=owl_global_get_current_view(&g);
m=owl_view_get_element(v, owl_global_get_curmsg(&g));
Expand Down Expand Up @@ -3077,7 +3082,8 @@ void owl_function_buddylist(int aim, int zephyr, char *filename)
#ifdef HAVE_LIBZEPHYR
int x;
owl_list anyone;
char *tmp, *user;
char *user;
char *tmp;
ZLocations_t location[200];
int numlocs, ret;
#endif
Expand Down
3 changes: 2 additions & 1 deletion global.c
Original file line number Diff line number Diff line change
Expand Up @@ -758,7 +758,8 @@ char *owl_global_get_aim_screenname_for_filters(owl_global *g)

void owl_global_set_aimloggedin(owl_global *g, char *screenname)
{
char *sn_escaped, *quote;
char *sn_escaped;
char *quote;
g->aim_loggedin=1;
if (g->aim_screenname) owl_free(g->aim_screenname);
if (g->aim_screenname_for_filters) owl_free(g->aim_screenname_for_filters);
Expand Down
3 changes: 2 additions & 1 deletion logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ void owl_log_outgoing_zephyr_error(char *to, char *text)
void owl_log_incoming(owl_message *m)
{
char filename[MAXPATHLEN], allfilename[MAXPATHLEN], *logpath;
char *frombuff=NULL, *from=NULL;
char *from=NULL;
char *frombuff=NULL;
int len, ch, i, personal;

/* figure out if it's a "personal" message or not */
Expand Down
12 changes: 8 additions & 4 deletions message.c
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,8 @@ int owl_message_is_mail(owl_message *m)
/* caller must free return value. */
char *owl_message_get_cc(owl_message *m)
{
char *cur, *out, *end;
char *cur;
char *out, *end;

cur = owl_message_get_body(m);
while (*cur && *cur==' ') cur++;
Expand All @@ -583,7 +584,8 @@ char *owl_message_get_cc(owl_message *m)
/* caller must free return value */
char *owl_message_get_cc_without_recipient(owl_message *m)
{
char *cc, *out, *end, *user, *shortuser, *recip;
char *cc, *out, *end, *shortuser, *recip;
char *user;

cc = owl_message_get_cc(m);
if (cc == NULL)
Expand Down Expand Up @@ -734,7 +736,8 @@ void owl_message_create_loopback(owl_message *m, char *text)
void owl_message_create_from_znotice(owl_message *m, ZNotice_t *n)
{
struct hostent *hent;
char *ptr, *tmp, *tmp2;
char *ptr;
char *tmp, *tmp2;
int len;

owl_message_init(m);
Expand Down Expand Up @@ -850,7 +853,8 @@ void owl_message_create_from_znotice(owl_message *m, void *n)
/* If 'direction' is '0' it is a login message, '1' is a logout message. */
void owl_message_create_pseudo_zlogin(owl_message *m, int direction, char *user, char *host, char *time, char *tty)
{
char *longuser, *ptr;
char *longuser;
char *ptr;

#ifdef HAVE_LIBZEPHYR
memset(&(m->notice), 0, sizeof(ZNotice_t));
Expand Down
3 changes: 2 additions & 1 deletion owl.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ int main(int argc, char **argv, char **env)
int debug, argcsave, followlast;
int newmsgs, nexttimediff;
struct sigaction sigact;
char *configfile, *tty, *perlout, *perlerr, **argvsave;
char *configfile, *tty, **argvsave;
char *perlout, *perlerr;
char *confdir;
owl_filter *f;
owl_style *s;
Expand Down
3 changes: 2 additions & 1 deletion perlconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,8 @@ char *owl_perlconfig_execute(char *line)
{
STRLEN len;
SV *response;
char *out, *preout;
char *preout;
char *out;

if (!owl_global_have_config(&g)) return NULL;

Expand Down
3 changes: 2 additions & 1 deletion style.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ char *owl_style_get_description(owl_style *s)
*/
void owl_style_get_formattext(owl_style *s, owl_fmtext *fm, owl_message *m)
{
char *body, *indent;
char *body;
char *indent;
int curlen;

SV *sv = NULL;
Expand Down
3 changes: 2 additions & 1 deletion text.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ int owl_text_num_lines(char *in)
/* caller must free the return */
char *owl_text_htmlstrip(char *in)
{
char *ptr1, *end, *ptr2, *ptr3, *out, *out2;
char *ptr1, *end, *ptr2, *ptr3;
char *out, *out2;

out=owl_malloc(strlen(in)+30);
strcpy(out, "");
Expand Down
3 changes: 2 additions & 1 deletion util.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,8 @@ char *owl_util_color_to_string(int color)
/* Get the default tty name. Caller must free the return */
char *owl_util_get_default_tty()
{
char *out, *tmp;
char *tmp;
char *out;

if (getenv("DISPLAY")) {
out=owl_strdup(getenv("DISPLAY"));
Expand Down
3 changes: 2 additions & 1 deletion zcrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ int des_ecb_encrypt(char [], char [], des_key_schedule, int);
* return 0 on success, otherwise -1
*/
int owl_zcrypt_decrypt(char *out, char *in, char *class, char *instance) {
char *fname, keystring[MAX_KEY], *inptr, *endptr;
char *inptr, *endptr;
char *fname, keystring[MAX_KEY];
FILE *fkey;
des_cblock key;
des_key_schedule schedule;
Expand Down
6 changes: 4 additions & 2 deletions zwrite.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
int owl_zwrite_create_from_line(owl_zwrite *z, char *line)
{
int argc, badargs, myargc, i, len;
char **argv, **myargv;
char **argv;
char **myargv;
char *msg = NULL;

badargs=0;
Expand Down Expand Up @@ -150,7 +151,8 @@ int owl_zwrite_create_from_line(owl_zwrite *z, char *line)

void owl_zwrite_populate_zsig(owl_zwrite *z)
{
char *zsigproc, *zsigowlvar, *zsigzvar, *ptr;
char *zsigproc, *zsigowlvar, *zsigzvar;
char *ptr;
struct passwd *pw;

/* get a zsig, if not given */
Expand Down

0 comments on commit 65b2173

Please sign in to comment.