gnuplot/gnuplot-signed-char.patch
2021-10-18 21:53:26 -04:00

40 lines
1.3 KiB
Diff

From 10995e7043211c793d545e7b2cc95acb4760e479 Mon Sep 17 00:00:00 2001
From: Ethan A Merritt <merritt@u.washington.edu>
Date: Sun, 17 Oct 2021 14:28:41 -0700
Subject: [PATCH] arm and s390 need "signed char"
The default is unsigned, which breaks array bound checks in the
vplot.c isosurface code.
Bugs #2467 #2450
---
src/marching_cubes.h | 2 +-
src/qt_table.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/marching_cubes.h b/src/marching_cubes.h
index 4f7264f93..4f1a5a872 100644
--- a/src/marching_cubes.h
+++ b/src/marching_cubes.h
@@ -58,7 +58,7 @@ static const short cube_edge_flags[256]=
First official public domain release
Version 3.00 dated 8-6-94
*/
-static char triangle_table[256][13]=
+static signed char triangle_table[256][13]=
{
{-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
{ 8, 3, 0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1},
diff --git a/src/qt_table.h b/src/qt_table.h
index 9e4ebf8e8..747ef8ec1 100644
--- a/src/qt_table.h
+++ b/src/qt_table.h
@@ -10,7 +10,7 @@
* collapsed them into quadrangles.
* So there is room for improvement in this table.
*/
-static char qt_table[256][13] =
+static signed char qt_table[256][13] =
{
{ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},
{ 8, 3, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1},