return NULL;
} else
#endif
- return strcasestr(haystack, needle);
+ return (char *) strcasestr(haystack, needle);
}
#if !defined(NANO_TINY) || !defined(DISABLE_TABCOMP)
return (char *)q;
} else
#endif
- return strchr(s, *c);
+ return (char *) strchr(s, *c);
}
#endif /* !NANO_TINY || !DISABLE_JUSTIFY */
return NULL;
} else
#endif
- return strpbrk(s, accept);
+ return (char *) strpbrk(s, accept);
}
/* This function is equivalent to strpbrk(), except in that it scans the
/* Return the constructed dorfile path, or NULL if we can't find the home
* directory. The string is dynamically allocated, and should be
* freed. */
-char *construct_filename(char *str)
+char *construct_filename(const char *str)
{
char *newstr = NULL;
char *histfilename(void)
{
- return construct_filename( "/.nano/search_history");
+ return construct_filename("/.nano/search_history");
}
/* Construct the legacy history filename
char *poshistfilename(void)
{
- return construct_filename( "/.nano/filepos_history");
+ return construct_filename("/.nano/filepos_history");
}
struct stat hstat;
- if (histfilename && stat(legacyhist, &hstat) != -1
- && stat(nanohist, &hstat) == -1) {
+ if (stat(legacyhist, &hstat) != -1 && stat(nanohist, &hstat) == -1) {
if (rename(legacyhist, nanohist) == -1)
history_error(N_("Detected a legacy nano history file (%s) which I tried to move\nto the preferred location (%s) but encountered an error: %s"),
legacyhist, nanohist, strerror(errno));
/* Didn't find it, make a new node yo! */
- posptr = nmalloc(sizeof(poshiststruct));
+ posptr = (poshiststruct *) nmalloc(sizeof(poshiststruct));
posptr->filename = mallocstrcpy(NULL, fullpath);
posptr->lineno = lineno;
posptr->xno = xpos;
lineno = atoi(lineptr);
xno = atoi(xptr);
if (poshistory == NULL) {
- poshistory = nmalloc(sizeof(poshiststruct));
+ poshistory = (poshiststruct *) nmalloc(sizeof(poshiststruct));
poshistory->filename = mallocstrcpy(NULL, line);
poshistory->lineno = lineno;
poshistory->xno = xno;
} else {
for (posptr = poshistory; posptr->next != NULL; posptr = posptr->next)
;
- posptr->next = nmalloc(sizeof(poshiststruct));
+ posptr->next = (poshiststruct *) nmalloc(sizeof(poshiststruct));
posptr->next->filename = mallocstrcpy(NULL, line);
posptr->next->lineno = lineno;
posptr->next->xno = xno;