Browse Source

* syntax.c (this_try_alloc_color_pair): Added const qualifiers.
* editcmd.c (snprintf_p): Likewise. (edit_replace_prompt):
Simplified the code.

Roland Illig 20 years ago
parent
commit
2a2b478f67
2 changed files with 6 additions and 4 deletions
  1. 2 0
      edit/ChangeLog
  2. 4 4
      edit/editcmd.c

+ 2 - 0
edit/ChangeLog

@@ -1,6 +1,8 @@
 2004-09-25  Roland Illig  <roland.illig@gmx.de>
 
 	* syntax.c (this_try_alloc_color_pair): Added const qualifiers.
+	* editcmd.c (snprintf_p): Likewise. (edit_replace_prompt):
+	Simplified the code.
 
 2004-09-25  Pavel S. Shirshov <pavelsh@mail.ru>
 

+ 4 - 4
edit/editcmd.c

@@ -1183,9 +1183,8 @@ edit_replace_prompt (WEdit * edit, char *replace_text, int xpos, int ypos)
 
     GString *label_text = g_string_new (_(" Replace with: "));
     if (*replace_text) {
-        size_t label_text_len = label_text->len;
         g_string_append (label_text, replace_text);
-        convert_to_display (label_text->str + label_text_len);
+        convert_to_display (label_text->str + label_text->len);
     }
     quick_widgets[5].text = label_text->str;
 
@@ -1633,13 +1632,14 @@ static int snprintf_p (char *str, size_t size, const char *fmt,...)
 {
     va_list ap;
     size_t n;
-    char *q, *p, *s = str, *e = str + size;
+    const char *q, *p;
+    char *s = str, *e = str + size;
     char q1[40];
     char *p1;
     int nargs = 0;
 
     va_start (ap, fmt);
-    p = q = (char *) fmt;
+    p = q = fmt;
 
     while ((p = strchr (p, '%'))) {
 	n = p - q;