Nux

Merge lp:~3v1n0/nux/gcc-7-fixes into lp:nux

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Andrea Azzarone
Approved revision: 890
Merged at revision: 889
Proposed branch: lp:~3v1n0/nux/gcc-7-fixes
Merge into: lp:nux
Diff against target: 258 lines (+79/-18)
6 files modified
Nux/InputMethodIBus.cpp (+1/-0)
Nux/RGBValuator.cpp (+2/-0)
Nux/TextEntry.cpp (+38/-9)
NuxCore/Character/NUni.cpp (+32/-8)
debian/rules (+1/-1)
tests/geis_mock.cpp (+5/-0)
To merge this branch: bzr merge lp:~3v1n0/nux/gcc-7-fixes
Reviewer Review Type Date Requested Status
Andrea Azzarone (community) Approve
Review via email: mp+329151@code.launchpad.net

Commit message

Nux: mark explicit fallthrough jumps (to please gcc7)

To post a comment you must log in.
Revision history for this message
Andrea Azzarone (azzar1) wrote :

+1

review: Approve
lp:~3v1n0/nux/gcc-7-fixes updated
891. By Marco Trevisan (Treviño)

geis-mock: add geis definitions inside extern "C"

892. By Marco Trevisan (Treviño)

debian/rules: disable tests on s390x

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Nux/InputMethodIBus.cpp'
--- Nux/InputMethodIBus.cpp 2015-04-22 16:48:10 +0000
+++ Nux/InputMethodIBus.cpp 2017-09-22 13:11:49 +0000
@@ -472,6 +472,7 @@
472 case XK_Super_L:472 case XK_Super_L:
473 case XK_Super_R:473 case XK_Super_R:
474 ev.key_modifiers |= KEY_MODIFIER_SUPER;474 ev.key_modifiers |= KEY_MODIFIER_SUPER;
475 break;
475 case XK_Caps_Lock:476 case XK_Caps_Lock:
476 ev.key_modifiers |= KEY_MODIFIER_CAPS_LOCK;477 ev.key_modifiers |= KEY_MODIFIER_CAPS_LOCK;
477 break;478 break;
478479
=== modified file 'Nux/RGBValuator.cpp'
--- Nux/RGBValuator.cpp 2012-11-05 21:31:06 +0000
+++ Nux/RGBValuator.cpp 2017-09-22 13:11:49 +0000
@@ -85,12 +85,14 @@
85 SetColorModel(color::HSV);85 SetColorModel(color::HSV);
86 SetHSV(x, y, z);86 SetHSV(x, y, z);
87 SetAlpha(alpha);87 SetAlpha(alpha);
88 break;
88 }89 }
89 case color::HLS:90 case color::HLS:
90 {91 {
91 SetColorModel(color::HLS);92 SetColorModel(color::HLS);
92 SetHLS(x, y, z);93 SetHLS(x, y, z);
93 SetAlpha(alpha);94 SetAlpha(alpha);
95 break;
94 }96 }
95 default:97 default:
96 case color::RGB:98 case color::RGB:
9799
=== modified file 'Nux/TextEntry.cpp'
--- Nux/TextEntry.cpp 2017-02-13 12:41:29 +0000
+++ Nux/TextEntry.cpp 2017-09-22 13:11:49 +0000
@@ -2630,18 +2630,47 @@
2630 {2630 {
2631 default: return false;2631 default: return false;
2632 // Everything else falls through when "true"...2632 // Everything else falls through when "true"...
2633 case 4: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;2633 case 4:
2634 case 3: if ((a = (*--srcptr)) < 0x80 || a > 0xBF) return false;2634 if ((a = (*--srcptr)) < 0x80 || a > 0xBF)
2635 case 2: if ((a = (*--srcptr)) > 0xBF) return false;2635 return false;
2636 [[gnu::fallthrough]];
2637 case 3:
2638 if ((a = (*--srcptr)) < 0x80 || a > 0xBF)
2639 return false;
2640 [[gnu::fallthrough]];
2641 case 2:
2642 if ((a = (*--srcptr)) > 0xBF)
2643 return false;
2644
2636 switch (ch) {2645 switch (ch) {
2637 // No fall-through in this inner switch2646 // No fall-through in this inner switch
2638 case 0xE0: if (a < 0xA0) return false; break;2647 case 0xE0:
2639 case 0xED: if (a > 0x9F) return false; break;2648 if (a < 0xA0)
2640 case 0xF0: if (a < 0x90) return false; break;2649 return false;
2641 case 0xF4: if (a > 0x8F) return false; break;2650 break;
2642 default: if (a < 0x80) return false;2651 case 0xED:
2652 if (a > 0x9F)
2653 return false;
2654 break;
2655 case 0xF0:
2656 if (a < 0x90)
2657 return false;
2658 break;
2659 case 0xF4:
2660 if (a > 0x8F)
2661 return false;
2662 break;
2663 default:
2664 if (a < 0x80)
2665 return false;
2643 }2666 }
2644 case 1: if (ch >= 0x80 && ch < 0xC2) return false;2667
2668 [[gnu::fallthrough]];
2669 case 1:
2670 if (ch >= 0x80 && ch < 0xC2)
2671 return false;
2672
2673 [[gnu::fallthrough]];
2645 }2674 }
26462675
2647 if (ch > 0xF4) return false;2676 if (ch > 0xF4) return false;
26482677
=== modified file 'NuxCore/Character/NUni.cpp'
--- NuxCore/Character/NUni.cpp 2013-11-05 14:15:00 +0000
+++ NuxCore/Character/NUni.cpp 2017-09-22 13:11:49 +0000
@@ -371,12 +371,15 @@
371 case 4:371 case 4:
372 *--target = (unsigned char) ( (ch | byteMark) & byteMask);372 *--target = (unsigned char) ( (ch | byteMark) & byteMask);
373 ch >>= 6;373 ch >>= 6;
374 [[gnu::fallthrough]];
374 case 3:375 case 3:
375 *--target = (unsigned char) ( (ch | byteMark) & byteMask);376 *--target = (unsigned char) ( (ch | byteMark) & byteMask);
376 ch >>= 6;377 ch >>= 6;
378 [[gnu::fallthrough]];
377 case 2:379 case 2:
378 *--target = (unsigned char) ( (ch | byteMark) & byteMask);380 *--target = (unsigned char) ( (ch | byteMark) & byteMask);
379 ch >>= 6;381 ch >>= 6;
382 [[gnu::fallthrough]];
380 case 1:383 case 1:
381 *--target = (unsigned char) (ch | firstByteMark[bytesToWrite]);384 *--target = (unsigned char) (ch | firstByteMark[bytesToWrite]);
382 }385 }
@@ -413,16 +416,19 @@
413 return false;416 return false;
414 /* Everything else falls through when "true"... */417 /* Everything else falls through when "true"... */
415 case 4:418 case 4:
416419 if ( (a = (*--srcptr) ) < 0x80 || a > 0xBF)
417 if ( (a = (*--srcptr) ) < 0x80 || a > 0xBF) return false;420 return false;
418421
422 [[gnu::fallthrough]];
419 case 3:423 case 3:
420424 if ( (a = (*--srcptr) ) < 0x80 || a > 0xBF)
421 if ( (a = (*--srcptr) ) < 0x80 || a > 0xBF) return false;425 return false;
422426
427 [[gnu::fallthrough]];
423 case 2:428 case 2:
424429
425 if ( (a = (*--srcptr) ) > 0xBF) return false;430 if ( (a = (*--srcptr) ) > 0xBF)
431 return false;
426432
427 switch (*source)433 switch (*source)
428 {434 {
@@ -452,9 +458,13 @@
452 if (a < 0x80) return false;458 if (a < 0x80) return false;
453 }459 }
454460
461 [[gnu::fallthrough]];
462
455 case 1:463 case 1:
464 if (*source >= 0x80 && *source < 0xC2)
465 return false;
456466
457 if (*source >= 0x80 && *source < 0xC2) return false;467 [[gnu::fallthrough]];
458 }468 }
459469
460 if (*source > 0xF4) return false;470 if (*source > 0xF4) return false;
@@ -597,18 +607,23 @@
597 case 5:607 case 5:
598 ch += *source++;608 ch += *source++;
599 ch <<= 6; /* remember, illegal UTF-8 */609 ch <<= 6; /* remember, illegal UTF-8 */
610 [[gnu::fallthrough]];
600 case 4:611 case 4:
601 ch += *source++;612 ch += *source++;
602 ch <<= 6; /* remember, illegal UTF-8 */613 ch <<= 6; /* remember, illegal UTF-8 */
614 [[gnu::fallthrough]];
603 case 3:615 case 3:
604 ch += *source++;616 ch += *source++;
605 ch <<= 6;617 ch <<= 6;
618 [[gnu::fallthrough]];
606 case 2:619 case 2:
607 ch += *source++;620 ch += *source++;
608 ch <<= 6;621 ch <<= 6;
622 [[gnu::fallthrough]];
609 case 1:623 case 1:
610 ch += *source++;624 ch += *source++;
611 ch <<= 6;625 ch <<= 6;
626 [[gnu::fallthrough]];
612 case 0:627 case 0:
613 ch += *source++;628 ch += *source++;
614 }629 }
@@ -748,12 +763,15 @@
748 case 4:763 case 4:
749 *--target = (unsigned char) ( (ch | byteMark) & byteMask);764 *--target = (unsigned char) ( (ch | byteMark) & byteMask);
750 ch >>= 6;765 ch >>= 6;
766 [[gnu::fallthrough]];
751 case 3:767 case 3:
752 *--target = (unsigned char) ( (ch | byteMark) & byteMask);768 *--target = (unsigned char) ( (ch | byteMark) & byteMask);
753 ch >>= 6;769 ch >>= 6;
770 [[gnu::fallthrough]];
754 case 2:771 case 2:
755 *--target = (unsigned char) ( (ch | byteMark) & byteMask);772 *--target = (unsigned char) ( (ch | byteMark) & byteMask);
756 ch >>= 6;773 ch >>= 6;
774 [[gnu::fallthrough]];
757 case 1:775 case 1:
758 *--target = (unsigned char) (ch | firstByteMark[bytesToWrite]);776 *--target = (unsigned char) (ch | firstByteMark[bytesToWrite]);
759 }777 }
@@ -802,18 +820,23 @@
802 case 5:820 case 5:
803 ch += *source++;821 ch += *source++;
804 ch <<= 6;822 ch <<= 6;
823 [[gnu::fallthrough]];
805 case 4:824 case 4:
806 ch += *source++;825 ch += *source++;
807 ch <<= 6;826 ch <<= 6;
827 [[gnu::fallthrough]];
808 case 3:828 case 3:
809 ch += *source++;829 ch += *source++;
810 ch <<= 6;830 ch <<= 6;
831 [[gnu::fallthrough]];
811 case 2:832 case 2:
812 ch += *source++;833 ch += *source++;
813 ch <<= 6;834 ch <<= 6;
835 [[gnu::fallthrough]];
814 case 1:836 case 1:
815 ch += *source++;837 ch += *source++;
816 ch <<= 6;838 ch <<= 6;
839 [[gnu::fallthrough]];
817 case 0:840 case 0:
818 ch += *source++;841 ch += *source++;
819 }842 }
@@ -875,6 +898,7 @@
875 ch += *source++;898 ch += *source++;
876 --tmpBytesToRead;899 --tmpBytesToRead;
877 if (tmpBytesToRead) ch <<= 6;900 if (tmpBytesToRead) ch <<= 6;
901 [[gnu::fallthrough]];
878 } while (tmpBytesToRead > 0);902 } while (tmpBytesToRead > 0);
879 }903 }
880 In UTF-8 writing code, the switches on "bytesToWrite" are904 In UTF-8 writing code, the switches on "bytesToWrite" are
881905
=== modified file 'debian/rules'
--- debian/rules 2016-04-18 13:56:06 +0000
+++ debian/rules 2017-09-22 13:11:49 +0000
@@ -7,7 +7,7 @@
7gles2_architectures := armel armhf7gles2_architectures := armel armhf
88
9ifneq (,$(filter $(DEB_HOST_ARCH),s390x))9ifneq (,$(filter $(DEB_HOST_ARCH),s390x))
10 DEB_BUILD_OPTIONS := $(DEB_BUILD_OPTIONS) noopt10 DEB_BUILD_OPTIONS := $(DEB_BUILD_OPTIONS) noopt nocheck
11 export DEB_BUILD_OPTIONS11 export DEB_BUILD_OPTIONS
12endif12endif
1313
1414
=== modified file 'tests/geis_mock.cpp'
--- tests/geis_mock.cpp 2012-09-30 23:28:23 +0000
+++ tests/geis_mock.cpp 2017-09-22 13:11:49 +0000
@@ -96,6 +96,9 @@
96 vector.push_back(std::move(attr));96 vector.push_back(std::move(attr));
97}97}
9898
99extern "C"
100{
101
99/******* Geis *******/102/******* Geis *******/
100103
101Geis geis_new(GeisString /* init_arg_name */, ...)104Geis geis_new(GeisString /* init_arg_name */, ...)
@@ -481,3 +484,5 @@
481 }484 }
482 return GEIS_STATUS_BAD_ARGUMENT;485 return GEIS_STATUS_BAD_ARGUMENT;
483}486}
487
488} // extern "C"

Subscribers

People subscribed via source and target branches