changeset 31453:06a1c71c58ad v9.0.1059

patch 9.0.1059: build failure with some compilers Commit: https://github.com/vim/vim/commit/f94178db8d7324099b1bf916a0dff022c08abdff Author: Bram Moolenaar <Bram@vim.org> Date: Wed Dec 14 17:50:00 2022 +0000 patch 9.0.1059: build failure with some compilers Problem: Build failure with some compilers that can't handle a declaration directly after a "case" statement. Solution: Add a block to put the declarations in.
author Bram Moolenaar <Bram@vim.org>
date Wed, 14 Dec 2022 19:00:04 +0100
parents 3c80e2e69e52
children d03a62e7fe0e
files src/eval.c src/version.c
diffstat 2 files changed, 26 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/eval.c
+++ b/src/eval.c
@@ -5874,32 +5874,36 @@ echo_string_core(
 	    break;
 
 	case VAR_OBJECT:
-	    garray_T ga;
-	    ga_init2(&ga, 1, 50);
-	    ga_concat(&ga, (char_u *)"object of ");
-	    object_T *obj = tv->vval.v_object;
-	    class_T *cl = obj == NULL ? NULL : obj->obj_class;
-	    ga_concat(&ga, cl == NULL ? (char_u *)"[unknown]" : cl->class_name);
-	    if (cl != NULL)
 	    {
-		ga_concat(&ga, (char_u *)" {");
-		for (int i = 0; i < cl->class_obj_member_count; ++i)
+		garray_T ga;
+		ga_init2(&ga, 1, 50);
+		ga_concat(&ga, (char_u *)"object of ");
+		object_T *obj = tv->vval.v_object;
+		class_T *cl = obj == NULL ? NULL : obj->obj_class;
+		ga_concat(&ga, cl == NULL ? (char_u *)"[unknown]"
+							     : cl->class_name);
+		if (cl != NULL)
 		{
-		    if (i > 0)
-			ga_concat(&ga, (char_u *)", ");
-		    objmember_T *m = &cl->class_obj_members[i];
-		    ga_concat(&ga, m->om_name);
-		    ga_concat(&ga, (char_u *)": ");
-		    char_u *tf = NULL;
-		    ga_concat(&ga, echo_string_core((typval_T *)(obj + 1) + i,
+		    ga_concat(&ga, (char_u *)" {");
+		    for (int i = 0; i < cl->class_obj_member_count; ++i)
+		    {
+			if (i > 0)
+			    ga_concat(&ga, (char_u *)", ");
+			objmember_T *m = &cl->class_obj_members[i];
+			ga_concat(&ga, m->om_name);
+			ga_concat(&ga, (char_u *)": ");
+			char_u *tf = NULL;
+			ga_concat(&ga, echo_string_core(
+					       (typval_T *)(obj + 1) + i,
 					       &tf, numbuf, copyID, echo_style,
 					       restore_copyID, composite_val));
-		    vim_free(tf);
+			vim_free(tf);
+		    }
+		    ga_concat(&ga, (char_u *)"}");
 		}
-		ga_concat(&ga, (char_u *)"}");
+
+		*tofree = r = ga.ga_data;
 	    }
-
-	    *tofree = r = ga.ga_data;
 	    break;
 
 	case VAR_FLOAT:
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1059,
+/**/
     1058,
 /**/
     1057,