From 368623577dc4f944e8a4f3e63375e0d20024d9fc Mon Sep 17 00:00:00 2001
From: Martin Nilsson <nilsson@opera.com>
Date: Mon, 18 Aug 2014 23:31:29 +0200
Subject: [PATCH] Shortened some error messages.

---
 src/backend.cmod        |  4 ++--
 src/builtin_functions.c | 30 +++++++++++++++---------------
 src/encode.c            | 18 +++++++++---------
 src/operators.c         |  2 +-
 src/security.c          |  6 +++---
 src/signal_handler.c    |  2 +-
 src/sprintf.c           |  2 +-
 7 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/src/backend.cmod b/src/backend.cmod
index bd5025cad5..860738f90b 100644
--- a/src/backend.cmod
+++ b/src/backend.cmod
@@ -958,7 +958,7 @@ PIKECLASS Backend
 
        c = get_storage(co, Backend_CallOut_program);
 
-       if (!c) Pike_error("low_call_out(): Unexpected object from CallOut.\n");
+       if (!c) Pike_error("Unexpected object from CallOut.\n");
 
        ref_push_array(c->args);
 
@@ -4417,7 +4417,7 @@ static void check_set_timer(struct timeval tmp)
       }
       else
       {
-        Pike_error("ERROR: unable to create run loop timer!\n");
+        Pike_error("Unable to create run loop timer!\n");
       }
     }
   }
diff --git a/src/builtin_functions.c b/src/builtin_functions.c
index 6caed4640c..1caa4f076d 100644
--- a/src/builtin_functions.c
+++ b/src/builtin_functions.c
@@ -1158,7 +1158,7 @@ PMOD_EXPORT void f_has_prefix(INT32 args)
     int inherit_no = SUBTYPEOF(Pike_sp[-args]);
 
     if (!o->prog || FIND_LFUN(o->prog, LFUN__SIZEOF) < 0) {
-      Pike_error("has_prefix(): Object in argument 1 lacks lfun::_sizeof().\n");
+      Pike_error("Object in argument 1 lacks lfun::_sizeof().\n");
     }
 
     apply_lfun(o, LFUN__SIZEOF, 0);
@@ -1232,7 +1232,7 @@ PMOD_EXPORT void f_has_prefix(INT32 args)
     CASE_SHIFT(2,0);
     CASE_SHIFT(2,1);
   default:
-    Pike_error("has_prefix(): Unexpected string shift combination: a:%d, b:%d!\n",
+    Pike_error("Unexpected string shift combination: a:%d, b:%d!\n",
 	  a->size_shift, b->size_shift);
     break;
   }
@@ -1306,7 +1306,7 @@ PMOD_EXPORT void f_has_suffix(INT32 args)
     CASE_SHIFT(2,0);
     CASE_SHIFT(2,1);
   default:
-    Pike_error("has_prefix(): Unexpected string shift combination: a:%d, b:%d!\n",
+    Pike_error("Unexpected string shift combination: a:%d, b:%d!\n",
 	  a->size_shift, b->size_shift);
     break;
   }
@@ -1752,14 +1752,14 @@ PMOD_EXPORT void f_string_to_unicode(INT32 args)
 	    /* 0xfffe: Byte-order detection illegal character.
 	     * 0xffff: Illegal character.
 	     */
-	    Pike_error("string_to_unicode(): Illegal character 0x%04x (index %ld) "
-		  "is not a Unicode character.",
-		  str2[i], PTRDIFF_T_TO_LONG(i));
+	    Pike_error("Illegal character 0x%04x (index %ld) "
+                       "is not a Unicode character.",
+                       str2[i], PTRDIFF_T_TO_LONG(i));
 	  }
 	  if (str2[i] > 0x10ffff) {
-	    Pike_error("string_to_unicode(): Character 0x%08x (index %ld) "
-		  "is out of range (0x00000000..0x0010ffff).",
-		  str2[i], PTRDIFF_T_TO_LONG(i));
+	    Pike_error("Character 0x%08x (index %ld) "
+                       "is out of range (0x00000000..0x0010ffff).",
+                       str2[i], PTRDIFF_T_TO_LONG(i));
 	  }
 	  /* Extra wide characters take two unicode characters in space.
 	   * ie One unicode character extra.
@@ -2509,9 +2509,9 @@ PMOD_EXPORT void f_utf8_to_string(INT32 args)
 
 #ifdef PIKE_DEBUG
   if (j != len) {
-    Pike_fatal("utf8_to_string(): Calculated and actual lengths differ: "
+    Pike_fatal("Calculated and actual lengths differ: "
 	       "%"PRINTPTRDIFFT"d != %"PRINTPTRDIFFT"d\n",
-	  len, j);
+               len, j);
   }
 #endif /* PIKE_DEBUG */
   out = low_end_shared_string(out);
@@ -6342,18 +6342,18 @@ static void f_interleave_array(INT32 args)
     INT_TYPE low = MAX_INT_TYPE;
 #ifdef PIKE_DEBUG
     if (TYPEOF(ITEM(arr)[i]) != T_MAPPING) {
-      Pike_error("interleave_array(): Element %d is not a mapping!\n", i);
+      Pike_error("Element %d is not a mapping!\n", i);
     }
 #endif /* PIKE_DEBUG */
     md = ITEM(arr)[i].u.mapping->data;
     NEW_MAPPING_LOOP(md) {
       if (TYPEOF(k->ind) != T_INT) {
-	Pike_error("interleave_array(): Index not an integer in mapping %d!\n", i);
+	Pike_error("Index not an integer in mapping %d!\n", i);
       }
       if (low > k->ind.u.integer) {
 	low = k->ind.u.integer;
 	if (low < 0) {
-	  Pike_error("interleave_array(): Index %"PRINTPIKEINT"d in mapping %d is negative!\n",
+	  Pike_error("Index %"PRINTPIKEINT"d in mapping %d is negative!\n",
 		low, i);
 	}
       }
@@ -6439,7 +6439,7 @@ static void f_interleave_array(INT32 args)
 	char *newtab = realloc(tab, size*2 + max);
 	if (!newtab) {
 	  free(tab);
-	  Pike_error("interleave_array(): Couldn't extend table!\n");
+	  Pike_error("Couldn't extend table!\n");
 	}
 	tab = newtab;
 	MEMSET(tab + size + max, 0, size);
diff --git a/src/encode.c b/src/encode.c
index e0d752ac32..a216fac20d 100644
--- a/src/encode.c
+++ b/src/encode.c
@@ -845,8 +845,10 @@ static void encode_value2(struct svalue *val, struct encode_data *data, int forc
 	 */
 	push_int(36);
 	apply(val->u.object,"digits",1);
+#ifdef PIKE_DEBUG
 	if(TYPEOF(Pike_sp[-1]) != T_STRING)
 	  Pike_error("Gmp.mpz->digits did not return a string!\n");
+#endif
 	encode_value2(Pike_sp-1, data, 0);
 	pop_stack();
 	break;
@@ -1838,10 +1840,9 @@ void f_encode_value(INT32 args)
 
   if(args > 1 && TYPEOF(Pike_sp[1-args]) == T_OBJECT)
   {
-    if (SUBTYPEOF(Pike_sp[1-args])) {
-      Pike_error("encode_value: "
-		 "The codec may not be a subtyped object yet.\n");
-    }
+    if (SUBTYPEOF(Pike_sp[1-args]))
+      Pike_error("The codec may not be a subtyped object yet.\n");
+
     data->codec=Pike_sp[1-args].u.object;
     add_ref (data->codec);
   }else{
@@ -1916,10 +1917,9 @@ void f_encode_value_canonic(INT32 args)
 
   if(args > 1 && TYPEOF(Pike_sp[1-args]) == T_OBJECT)
   {
-    if (SUBTYPEOF(Pike_sp[1-args])) {
-      Pike_error("encode_value_canonic: "
-		 "The codec may not be a subtyped object yet.\n");
-    }
+    if (SUBTYPEOF(Pike_sp[1-args]))
+      Pike_error("The codec may not be a subtyped object yet.\n");
+
     data->codec=Pike_sp[1-args].u.object;
     add_ref (data->codec);
   }else{
@@ -2003,7 +2003,7 @@ static void decode_value2(struct decode_data *data);
 static int my_extract_char(struct decode_data *data)
 {
   if(data->ptr >= data->len)
-    Pike_error("Decode error: Not enough data in string.\n");
+    Pike_error("Not enough data in string.\n");
   return data->data [ data->ptr++ ];
 }
 
diff --git a/src/operators.c b/src/operators.c
index 1b69832ea8..b2c0f8d4d8 100644
--- a/src/operators.c
+++ b/src/operators.c
@@ -393,7 +393,7 @@ PMOD_EXPORT void o_cast_to_string(void)
 	  case 2:
 #if SIZEOF_INT_TYPE > 4
 	    if (val < MIN_INT32 || val > MAX_INT32)
-	      Pike_error ("cast: Item %d is too large: %"PRINTPIKEINT"x.\n",
+	      Pike_error ("Item %d is too large: %"PRINTPIKEINT"x.\n",
 			  i, val);
 #endif
 	    break;
diff --git a/src/security.c b/src/security.c
index 2f63ef15f7..71c3da2345 100644
--- a/src/security.c
+++ b/src/security.c
@@ -112,7 +112,7 @@ static void f_call_with_creds(INT32 args)
       if(!CHECK_SECURITY(SECURITY_BIT_SECURITY) &&
 	 !(Pike_fp->current_object->prot && 
 	   (OBJ2CREDS(Pike_fp->current_object->prot)->may_always & SECURITY_BIT_SECURITY)))
-	Pike_error("call_with_creds: permission denied.\n");
+	Pike_error("Permission denied.\n");
       
       break;
 
@@ -121,7 +121,7 @@ static void f_call_with_creds(INT32 args)
   }
     
   if(!valid_creds_object(o))
-    Pike_error("call_with_creds: Not a valid creds object.\n");
+    Pike_error("Not a valid creds object.\n");
 
   if(CURRENT_CREDS) add_ref(CURRENT_CREDS);
 
@@ -303,7 +303,7 @@ static void creds_apply(INT32 args)
       free_object(Pike_sp[-args].u.array->prot);
     add_ref( Pike_sp[-args].u.array->prot=Pike_fp->current_object );
   }else{
-    Pike_error("creds->apply(): permission denied.\n");
+    Pike_error("Permission denied.\n");
   }
   pop_n_elems(args);
 }
diff --git a/src/signal_handler.c b/src/signal_handler.c
index a32a82fe75..eb5aa93425 100644
--- a/src/signal_handler.c
+++ b/src/signal_handler.c
@@ -4548,7 +4548,7 @@ static void f_pid_status_kill(INT32 args)
   get_all_args("pid->kill", args, "%i", &signum);
 
   if (pid < 0) {
-    Pike_error("pid->kill(): No process\n");
+    Pike_error("No process\n");
   }
 
   PROC_FPRINTF((stderr, "[%d] pid->kill: pid=%d, signum=%d\n",
diff --git a/src/sprintf.c b/src/sprintf.c
index f7c9cc5706..c1c5deee6b 100644
--- a/src/sprintf.c
+++ b/src/sprintf.c
@@ -1925,7 +1925,7 @@ void low_f_sprintf(INT32 args, int compat_mode, struct string_builder *r)
       o_cast(string_type_string, PIKE_T_STRING);
       if (TYPEOF(Pike_sp[-1]) != T_STRING) {
 	/* We don't accept objects... */
-	Pike_error("sprintf(): Cast to string failed.\n");
+	Pike_error("Cast to string failed.\n");
       }
       /* Replace the original object with the new string. */
       assign_svalue(argp, Pike_sp-1);
-- 
GitLab