Skip to content

Commit 120bcd7

Browse files
committed
Add short[] support for printArray()
There are 8 primitive types in Java. Method **printArray()** supports all but `short`! :rage1: Although `short` isn't a Processing's "official" type, but neither are `long` nor `double`! 🙈 In order to correct this grave prejudiced injustice, I'm begging you devs to accept this pull request! 👼
1 parent 239710e commit 120bcd7

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

core/src/processing/core/PApplet.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4709,6 +4709,13 @@ static public void printArray(Object what) {
47094709
}
47104710
break;
47114711

4712+
case 'S': // short
4713+
short ss[] = (short[]) what;
4714+
for (int i = 0; i < ss.length; i++) {
4715+
System.out.println("[" + i + "] " + ss[i]);
4716+
}
4717+
break;
4718+
47124719
case 'C': // char
47134720
char cc[] = (char[]) what;
47144721
for (int i = 0; i < cc.length; i++) {
@@ -4723,7 +4730,7 @@ static public void printArray(Object what) {
47234730
}
47244731
break;
47254732

4726-
case 'J': // int
4733+
case 'J': // long
47274734
long jj[] = (long[]) what;
47284735
for (int i = 0; i < jj.length; i++) {
47294736
System.out.println("[" + i + "] " + jj[i]);

0 commit comments

Comments
 (0)