Skip to content

Commit 1b837f9

Browse files
committed
Integrate John Brant's fix for meta key release on X11:
changing unix key handling for Ctrl-letter and releasing the ctrl & shift keys Fix a missing external declaration in sqOpenGLRenderer.c. Fix some printf compiler warnings (long argument, int format) Revert the use of script in build.linux32x86/squeak.cog.spur/build.debug/mvm Add a couple of convenience build scripts.
1 parent 6e233d3 commit 1b837f9

File tree

7 files changed

+68
-23
lines changed

7 files changed

+68
-23
lines changed

build.linux32x86/squeak.cog.spur/build.debug/mvm

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,4 @@ rm -f vm/sqUnixMain.o # nuke version info
3333
rm -rf ../../../products/$INSTALLDIR
3434
# prefer make install prefix=`readlink -f \`pwd\`/../../../products/$INSTALLDIR`
3535
# but older linux readlinks lack the -f flag
36-
exec \
37-
script -f -q -e -c \
38-
"make install-squeak install-plugins prefix=`(cd ../../../;pwd)`/products/$INSTALLDIR" \
39-
>(sed "s/\x1B\[\([0-9]\{1,2\}\(;[0-9]\{1,2\}\)\?\)\?[mGK]//g" > LOG)
36+
make install-squeak install-plugins prefix=`(cd ../../../;pwd)`/products/$INSTALLDIR 2>&1 | tee LOG
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh -e
2+
trap 'exit 2' HUP INT PIPE TERM
3+
if [ "$1" = -fork ]; then
4+
shift
5+
for d in build.debug build.assert build; do
6+
(cd ./$d
7+
echo n | ./mvm "$@") &
8+
done
9+
wait
10+
else
11+
for d in build.debug build.assert build; do
12+
(cd ./$d
13+
echo n | ./mvm "$@")
14+
done
15+
fi
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/sh -e
2+
trap 'exit 2' HUP INT PIPE TERM
3+
if [ "$1" = -fork ]; then
4+
shift
5+
for d in build.debug build.assert build; do
6+
(cd ./$d
7+
echo n | ./mvm "$@") &
8+
done
9+
wait
10+
else
11+
for d in build.debug build.assert build; do
12+
(cd ./$d
13+
echo n | ./mvm "$@")
14+
done
15+
fi

platforms/Cross/plugins/B3DAcceleratorPlugin/sqOpenGLRenderer.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ closelog(void)
8484
# endif
8585
#endif
8686

87+
#if defined(SQUEAK_BUILTIN_PLUGIN)
88+
extern char *getImageName(void);
89+
#endif
90+
8791
int
8892
print3Dlog(char *fmt, ...)
8993
{ va_list args;

platforms/unix/vm-display-X11/sqUnixX11.c

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2062,6 +2062,17 @@ static int x2sqKeyPlain(XKeyEvent *xevt, KeySym *symbolic)
20622062
return -1; /* unknown key */
20632063
if ((charCode == 127) && mapDelBs)
20642064
charCode= 8;
2065+
if (charCode >= 1 && charCode <= 26) {
2066+
/* check for Ctrl-letter that gets translated into charCode 1-26 instead of letters a-z */
2067+
KeySym keysym = *symbolic;
2068+
if (keysym >= XK_a && keysym <= XK_z)
2069+
return (int)'a' + (keysym - XK_a);
2070+
if (keysym >= XK_A && keysym <= XK_Z)
2071+
return (int)'A' + (keysym - XK_A);
2072+
}
2073+
if (charCode >= 246 /* XK_Alt_R */ && charCode <= 255 /* XK_Shift_L */) /* hard coded values from translateCode */
2074+
/* The shift, ctrl, alt keys shouldn't be translated by the recode below */
2075+
return charCode;
20652076
return nConv == 0 && (modifierState & (CommandKeyBit+CtrlKeyBit+OptionKeyBit))
20662077
? charCode
20672078
: recode(charCode);
@@ -4792,7 +4803,7 @@ static sqInt display_ioFormPrint(sqInt bitsIndex, sqInt width, sqInt height, sqI
47924803
copyFn copy= ((depth > 0) && (depth <= 32)) ? copyFns[depth] : 0;
47934804
if (!copy)
47944805
{
4795-
fprintf(stderr, "ioFormPrint: depth %d not supported\n", depth);
4806+
fprintf(stderr, "ioFormPrint: depth %ld not supported\n", depth);
47964807
return false;
47974808
}
47984809

@@ -4834,7 +4845,7 @@ static sqInt display_ioFormPrint(sqInt bitsIndex, sqInt width, sqInt height, sqI
48344845
}
48354846

48364847
/* print the PPM magic number */
4837-
fprintf(ppm, "P3\n%d %d 255\n", width, height);
4848+
fprintf(ppm, "P3\n%ld %ld 255\n", width, height);
48384849

48394850
/* write the pixmap */
48404851
{
@@ -5485,7 +5496,7 @@ static sqInt display_ioShowDisplay(sqInt dispBitsIndex, sqInt width, sqInt heigh
54855496
if (!(depth == 1 || depth == 2 || depth == 4
54865497
|| depth == 8 || depth == 16 || depth == 32))
54875498
{
5488-
fprintf(stderr, "depth %d is not supported\n", depth);
5499+
fprintf(stderr, "depth %ld is not supported\n", depth);
54895500
exit(1);
54905501
return 0;
54915502
}
@@ -5818,7 +5829,7 @@ static sqInt display_ioHasDisplayDepth(sqInt i)
58185829

58195830
static sqInt display_ioSetDisplayMode(sqInt width, sqInt height, sqInt depth, sqInt fullscreenFlag)
58205831
{
5821-
fprintf(stderr, "ioSetDisplayMode(%d, %d, %d, %d)\n",
5832+
fprintf(stderr, "ioSetDisplayMode(%ld, %ld, %ld, %ld)\n",
58225833
width, height, depth, fullscreenFlag);
58235834
setSavedWindowSize((width << 16) + (height & 0xFFFF));
58245835
setFullScreenFlag(fullScreen);
@@ -6925,6 +6936,7 @@ closelog(void)
69256936
static int
69266937
myPrint3Dlog(char *fmt, ...)
69276938
{ va_list args;
6939+
int n;
69286940

69296941
if (!logfile) {
69306942
char *slash;
@@ -6949,10 +6961,11 @@ myPrint3Dlog(char *fmt, ...)
69496961
atexit(closelog);
69506962
}
69516963
va_start(args,fmt);
6952-
vfprintf(logfile, fmt, args);
6964+
n = vfprintf(logfile, fmt, args);
69536965
va_end(args);
69546966
if (forceFlush) /* from sqOpenGLRenderer.h */
69556967
fflush(logfile);
6968+
return n;
69566969
}
69576970

69586971
# include <GL/gl.h>
@@ -7261,7 +7274,7 @@ static long display_hostWindowSetTitle(long windowIndex, char *newTitle, long si
72617274
XChangeProperty(stDisplay, stParent,
72627275
XInternAtom(stDisplay, "_NET_WM_NAME", False),
72637276
XInternAtom(stDisplay, "UTF8_STRING", False),
7264-
8, PropModeReplace, newTitle, sizeOfTitle);
7277+
8, PropModeReplace, (unsigned char *)newTitle, sizeOfTitle);
72657278

72667279
return 0;
72677280
}
@@ -7279,7 +7292,7 @@ static long display_ioSizeOfNativeWindow(void *windowHandle)
72797292
* width.
72807293
*/
72817294
real_border_width= attrs.border_width ? attrs.border_width : attrs.x;
7282-
return (attrs.width + 2 * real_border_width << 16)
7295+
return ((attrs.width + 2 * real_border_width) << 16)
72837296
| (attrs.height + attrs.y + real_border_width);
72847297
}
72857298

@@ -7295,7 +7308,7 @@ static long display_ioPositionOfNativeWindow(void *windowHandle)
72957308
&rootx, &rooty, &neglected_child))
72967309
return -1;
72977310

7298-
return (rootx - attrs.x << 16) | (rooty - attrs.y);
7311+
return ((rootx - attrs.x) << 16) | (rooty - attrs.y);
72997312
}
73007313

73017314
#endif /* (SqDisplayVersionMajor >= 1 && SqDisplayVersionMinor >= 2) */

platforms/unix/vm-display-X11/sqUnixXdnd.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ struct { char *fileName; Window sourceWindow; } *launchDrops = 0;
755755
static int numLaunchDrops = 0;
756756

757757
/* drastically simplified case of dndInDrop that leaves out the 8 step dance
758-
* (see http://www.newplanetsoftware.com/xdnd/). Instead grab the fileName in
758+
* (see http://www.freedesktop.org/xdnd/). Instead grab the fileName in
759759
* the XdndSqueakLaunchDrop property and send an ack message.
760760
*/
761761
enum XdndState
@@ -800,6 +800,7 @@ dndInLaunchDrop(XClientMessageEvent *evt)
800800
launchDrops[i].fileName = fileName;
801801
launchDrops[i].sourceWindow = xdndDrop_sourceWindow(evt);
802802
}
803+
return XdndStateIdle; /* Added by eem 2018/12/14 to remove a compiler warning; Is this correct? */
803804
}
804805

805806
/* Send a XdndSqueakLaunchAck essage back to the launch dropper if the filename
@@ -1032,7 +1033,7 @@ windowHasLabel(Window w, char *label)
10321033
*/
10331034
if (win_text.nitems <= 0)
10341035
return 0;
1035-
hasLabel = !strcmp(label, win_text.value);
1036+
hasLabel = !strcmp(label, (char *)win_text.value);
10361037
(void)XFree(win_text.value);
10371038
return hasLabel;
10381039
}

platforms/unix/vm/sqUnixMain.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -988,14 +988,14 @@ static void *
988988
printRegisterState(ucontext_t *uap)
989989
{
990990
#if __linux__ && __i386__
991-
gregset_t *regs = &uap->uc_mcontext.gregs;
991+
greg_t *regs = (greg_t *)&uap->uc_mcontext.gregs;
992992
printf( "\teax 0x%08x ebx 0x%08x ecx 0x%08x edx 0x%08x\n"
993993
"\tedi 0x%08x esi 0x%08x ebp 0x%08x esp 0x%08x\n"
994994
"\teip 0x%08x\n",
995995
regs[REG_EAX], regs[REG_EBX], regs[REG_ECX], regs[REG_EDX],
996996
regs[REG_EDI], regs[REG_EDI], regs[REG_EBP], regs[REG_ESP],
997997
regs[REG_EIP]);
998-
return regs[REG_EIP];
998+
return (void *)regs[REG_EIP];
999999
#elif __FreeBSD__ && __i386__
10001000
struct mcontext *regs = &uap->uc_mcontext;
10011001
printf( "\teax 0x%08x ebx 0x%08x ecx 0x%08x edx 0x%08x\n"
@@ -1006,18 +1006,18 @@ printRegisterState(ucontext_t *uap)
10061006
regs->mc_eip);
10071007
return regs->mc_eip;
10081008
#elif __linux__ && __x86_64__
1009-
gregset_t *regs = &uap->uc_mcontext.gregs;
1010-
printf( "\trax 0x%08x rbx 0x%08x rcx 0x%08x rdx 0x%08x\n"
1011-
"\trdi 0x%08x rsi 0x%08x rbp 0x%08x rsp 0x%08x\n"
1012-
"\tr8 0x%08x r9 0x%08x r10 0x%08x r11 0x%08x\n"
1013-
"\tr12 0x%08x r13 0x%08x r14 0x%08x r15 0x%08x\n"
1014-
"\trip 0x%08x\n",
1009+
greg_t *regs = (greg_t *)&uap->uc_mcontext.gregs;
1010+
printf( "\trax 0x%08lx rbx 0x%08lx rcx 0x%08lx rdx 0x%08lx\n"
1011+
"\trdi 0x%08lx rsi 0x%08lx rbp 0x%08lx rsp 0x%08lx\n"
1012+
"\tr8 0x%08lx r9 0x%08lx r10 0x%08lx r11 0x%08lx\n"
1013+
"\tr12 0x%08lx r13 0x%08lx r14 0x%08lx r15 0x%08lx\n"
1014+
"\trip 0x%08lx\n",
10151015
regs[REG_RAX], regs[REG_RBX], regs[REG_RCX], regs[REG_RDX],
10161016
regs[REG_RDI], regs[REG_RDI], regs[REG_RBP], regs[REG_RSP],
10171017
regs[REG_R8 ], regs[REG_R9 ], regs[REG_R10], regs[REG_R11],
10181018
regs[REG_R12], regs[REG_R13], regs[REG_R14], regs[REG_R15],
10191019
regs[REG_RIP]);
1020-
return regs[REG_RIP];
1020+
return (void *)regs[REG_RIP];
10211021
# elif __linux__ && (defined(__arm64__))
10221022
printf("@@FIXME@@: derive register state from a ucontext_t on aarch64 \n");
10231023
return 0;

0 commit comments

Comments
 (0)