Check-in [320f5f00ae]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:merge with trunk
Timelines: family | ancestors | descendants | both | wtf-8-experiment
Files: files | file ages | folders
SHA1:320f5f00ae789043c28e9bd3a3b059094812be5e
User & Date: chw 2019-03-16 17:44:29
Context
2019-03-18
18:48
merge with trunk check-in: 2cc10d01ae user: chw tags: wtf-8-experiment
2019-03-16
17:44
merge with trunk check-in: 320f5f00ae user: chw tags: wtf-8-experiment
17:01
fix compiler warnings in libwebsockets, snap7, tkvlc, and tserialport check-in: 98264290ff user: chw tags: trunk
07:55
merge with trunk check-in: a9834b57f2 user: chw tags: wtf-8-experiment
Changes

Changes to jni/sdl2tk/generic/tkClipboard.c.

141
142
143
144
145
146
147

148
149
150
151
152
153
154
155
156
157
    p = dispPtr->clipboardAppPtr->winPtr->nameUid;
    length = strlen(p);
    length -= offset;
    if (length <= 0) {
	return 0;
    }
    if (length > (size_t) maxBytes) {

	length = maxBytes;
    }
    strncpy(buffer, p, length);
    return (int)length;
}
 
/*
 *----------------------------------------------------------------------
 *
 * ClipboardWindowHandler --







>
|

|







141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
    p = dispPtr->clipboardAppPtr->winPtr->nameUid;
    length = strlen(p);
    length -= offset;
    if (length <= 0) {
	return 0;
    }
    if (length > (size_t) maxBytes) {
	memcpy(buffer, p, maxBytes);
	return (int)maxBytes;
    }
    strcpy(buffer, p);
    return (int)length;
}
 
/*
 *----------------------------------------------------------------------
 *
 * ClipboardWindowHandler --

Changes to jni/sdl2tk/sdl/SdlTkInt.c.

1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
....
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
....
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
....
4015
4016
4017
4018
4019
4020
4021
4022



4023

4024
4025
4026
4027
4028
4029
4030
....
4040
4041
4042
4043
4044
4045
4046


4047
4048
4049





4050
4051
4052
4053
4054
4055
4056
4057
4058
4059

4060
4061
4062





4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
....
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
....
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
	    event->xany.send_event = False;
	    event->xany.window = (Window) SdlTkX.screen->root;
	    event->xbutton.root = (Window) SdlTkX.screen->root;
	    event->xany.display = SdlTkX.display;
	    ((XVirtualEvent *) event)->name = (Tk_Uid) evname;
	    event->xany.serial = SdlTkX.display->request;
	    event->xbutton.x = event->xbutton.y = sdl_event->user.code;
	    event->xbutton.state = (long) sdl_event->user.data2;
	    /* only TK_APP_TOP_LEVEL windows will get this */
	    event->xany.window = (Window)
		SendAppEvent(event, &nsent,
			     ((_Window *) SdlTkX.screen->root)->child);
	}
	return nsent > 0;
    }
................................................................................
	event->xany.display = SdlTkX.display;
	event->xany.serial = SdlTkX.display->request;
	event->xbutton.state = sdl_event->jdevice.which;
	event->xbutton.x_root = event->xbutton.y_root =
	    sdl_event->jdevice.which;
	if (sdl_event->type == SDL_JOYDEVICEADDED) {
	    SDL_Joystick *stick;
	    long which;
	    int new;
	    Tcl_HashEntry *hPtr;

	    stick = SDL_JoystickOpen(sdl_event->jdevice.which);
	    if (stick == NULL) {
		return 0;
	    }
................................................................................
		event->xbutton.state;
#ifdef ANDROID
	    if (strcmp(SDL_JoystickName(stick),
		       "Android Accelerometer") == 0) {
		SdlTkX.accel_id = event->xbutton.state;
	    }
#endif
	    which = event->xbutton.state;
	    hPtr = Tcl_CreateHashEntry(&SdlTkX.joystick_table,
				       (ClientData) which, &new);
	    if (!new) {
		SDL_JoystickClose(stick);
		return 0;
	    }
	    Tcl_SetHashValue(hPtr, (char *) stick);
	    ((XVirtualEvent *) event)->name = (Tk_Uid) "JoystickAdded";
	} else {
	    long which = sdl_event->jdevice.which;
	    Tcl_HashEntry *hPtr;

	    hPtr = Tcl_FindHashEntry(&SdlTkX.joystick_table,
				     (ClientData) which);
	    if (hPtr == NULL) {
		return 0;
	    }
	    SDL_JoystickClose((SDL_Joystick *) Tcl_GetHashValue(hPtr));
	    Tcl_DeleteHashEntry(hPtr);
	    ((XVirtualEvent *) event)->name = (Tk_Uid) "JoystickRemoved";
	}
................................................................................
	"numbuttons", "numhats",
	NULL
    };
    enum jopts {
	JOY_IDS, JOY_GUID, JOY_NAME, JOY_NAXES, JOY_NBALLS,
	JOY_NBUTTONS, JOY_NHATS
    };
    int index, joy_id;



    long joy_idl;

    Tcl_HashEntry *hPtr;
    SDL_Joystick *stick;

    if (objc < 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "suboption ?joyid?");
	return TCL_ERROR;
    }
................................................................................
	    Tcl_WrongNumArgs(interp, 2, objv, "");
	    return TCL_ERROR;
	}
	result = Tcl_NewListObj(0, NULL);
	SdlTkLock(NULL);
	hPtr = Tcl_FirstHashEntry(&SdlTkX.joystick_table, &search);
	while (hPtr != NULL) {


	    joy_idl = (long) Tcl_GetHashKey(&SdlTkX.joystick_table, hPtr);
	    Tcl_ListObjAppendElement(interp, result,
				     Tcl_NewIntObj((int) joy_idl));





	    hPtr = Tcl_NextHashEntry(&search);
	}
	SdlTkUnlock(NULL);
	Tcl_SetObjResult(interp, result);
	return TCL_OK;
    }
    if (objc != 3) {
	Tcl_WrongNumArgs(interp, 2, objv, "joyid");
	return TCL_ERROR;
    }

    if (Tcl_GetIntFromObj(interp, objv[2], &joy_id) != TCL_OK) {
	return TCL_ERROR;
    }





    SdlTkLock(NULL);
    joy_idl = joy_id;
    hPtr = Tcl_FindHashEntry(&SdlTkX.joystick_table, (ClientData) joy_idl);
    if (hPtr == NULL) {
	SdlTkUnlock(NULL);
	Tcl_SetResult(interp, "unknown joystick identifier", TCL_STATIC);
	return TCL_ERROR;
    }
    stick = (SDL_Joystick *) Tcl_GetHashValue(hPtr);
    switch (index) {
................................................................................

	if ((void *) new_sc != last_sc) {
	    last_sc = (void *) new_sc;
	    SdlTkSetSWCursor(new_sc);
	}
	return;
    }
    hPtr = Tcl_FindHashEntry(&SdlTkX.sdlcursors, (ClientData) shape);
    if (hPtr == NULL) {
#ifndef __HAIKU__
	if (SdlTkX.is_framebuffer) {
	    const unsigned char *data, *mask;
	    int x, y;

	    data = SdlTkGetSystemCursorData(shape);
................................................................................
#endif
	sc = SDL_CreateSystemCursor(shape);
madeCursor:
	if (sc != NULL) {
	    int isNew;

	    hPtr = Tcl_CreateHashEntry(&SdlTkX.sdlcursors,
				       (ClientData) shape, &isNew);
	    Tcl_SetHashValue(hPtr, (ClientData) sc);
	}
    } else {
	sc = (SDL_Cursor *) Tcl_GetHashValue(hPtr);
    }
    if (sc != NULL) {
	if ((void *) sc != last_sc) {







|







 







|







 







|
|
<







|


|
<







 







|
>
>
>
|
>







 







>
>
|

<
>
>
>
>
>










>
|


>
>
>
>
>

<
|







 







|







 







|







1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
....
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
....
2019
2020
2021
2022
2023
2024
2025
2026
2027

2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038

2039
2040
2041
2042
2043
2044
2045
....
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
....
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052

4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077

4078
4079
4080
4081
4082
4083
4084
4085
....
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
....
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
	    event->xany.send_event = False;
	    event->xany.window = (Window) SdlTkX.screen->root;
	    event->xbutton.root = (Window) SdlTkX.screen->root;
	    event->xany.display = SdlTkX.display;
	    ((XVirtualEvent *) event)->name = (Tk_Uid) evname;
	    event->xany.serial = SdlTkX.display->request;
	    event->xbutton.x = event->xbutton.y = sdl_event->user.code;
	    event->xbutton.state = PTR2INT(sdl_event->user.data2);
	    /* only TK_APP_TOP_LEVEL windows will get this */
	    event->xany.window = (Window)
		SendAppEvent(event, &nsent,
			     ((_Window *) SdlTkX.screen->root)->child);
	}
	return nsent > 0;
    }
................................................................................
	event->xany.display = SdlTkX.display;
	event->xany.serial = SdlTkX.display->request;
	event->xbutton.state = sdl_event->jdevice.which;
	event->xbutton.x_root = event->xbutton.y_root =
	    sdl_event->jdevice.which;
	if (sdl_event->type == SDL_JOYDEVICEADDED) {
	    SDL_Joystick *stick;
	    ClientData which;
	    int new;
	    Tcl_HashEntry *hPtr;

	    stick = SDL_JoystickOpen(sdl_event->jdevice.which);
	    if (stick == NULL) {
		return 0;
	    }
................................................................................
		event->xbutton.state;
#ifdef ANDROID
	    if (strcmp(SDL_JoystickName(stick),
		       "Android Accelerometer") == 0) {
		SdlTkX.accel_id = event->xbutton.state;
	    }
#endif
	    which = INT2PTR(event->xbutton.state);
	    hPtr = Tcl_CreateHashEntry(&SdlTkX.joystick_table, which, &new);

	    if (!new) {
		SDL_JoystickClose(stick);
		return 0;
	    }
	    Tcl_SetHashValue(hPtr, (char *) stick);
	    ((XVirtualEvent *) event)->name = (Tk_Uid) "JoystickAdded";
	} else {
	    ClientData which = INT2PTR(sdl_event->jdevice.which);
	    Tcl_HashEntry *hPtr;

	    hPtr = Tcl_FindHashEntry(&SdlTkX.joystick_table, which);

	    if (hPtr == NULL) {
		return 0;
	    }
	    SDL_JoystickClose((SDL_Joystick *) Tcl_GetHashValue(hPtr));
	    Tcl_DeleteHashEntry(hPtr);
	    ((XVirtualEvent *) event)->name = (Tk_Uid) "JoystickRemoved";
	}
................................................................................
	"numbuttons", "numhats",
	NULL
    };
    enum jopts {
	JOY_IDS, JOY_GUID, JOY_NAME, JOY_NAXES, JOY_NBALLS,
	JOY_NBUTTONS, JOY_NHATS
    };
    int index;
#ifdef _WIN64
    Tcl_WideInt joy_id;
#else
    long joy_id;
#endif
    Tcl_HashEntry *hPtr;
    SDL_Joystick *stick;

    if (objc < 2) {
	Tcl_WrongNumArgs(interp, 1, objv, "suboption ?joyid?");
	return TCL_ERROR;
    }
................................................................................
	    Tcl_WrongNumArgs(interp, 2, objv, "");
	    return TCL_ERROR;
	}
	result = Tcl_NewListObj(0, NULL);
	SdlTkLock(NULL);
	hPtr = Tcl_FirstHashEntry(&SdlTkX.joystick_table, &search);
	while (hPtr != NULL) {
#ifdef _WIN64
	    joy_id =
		    (Tcl_WideInt) Tcl_GetHashKey(&SdlTkX.joystick_table, hPtr);
	    Tcl_ListObjAppendElement(interp, result,

				     Tcl_NewWideIntObj(joy_id));
#else
	    joy_id = (long) Tcl_GetHashKey(&SdlTkX.joystick_table, hPtr);
	    Tcl_ListObjAppendElement(interp, result, Tcl_NewLongObj(joy_id));
#endif
	    hPtr = Tcl_NextHashEntry(&search);
	}
	SdlTkUnlock(NULL);
	Tcl_SetObjResult(interp, result);
	return TCL_OK;
    }
    if (objc != 3) {
	Tcl_WrongNumArgs(interp, 2, objv, "joyid");
	return TCL_ERROR;
    }
#ifdef _WIN64
    if (Tcl_GetWideIntFromObj(interp, objv[2], &joy_id) != TCL_OK) {
	return TCL_ERROR;
    }
#else
    if (Tcl_GetLongFromObj(interp, objv[2], &joy_id) != TCL_OK) {
	return TCL_ERROR;
    }
#endif
    SdlTkLock(NULL);

    hPtr = Tcl_FindHashEntry(&SdlTkX.joystick_table, (ClientData) joy_id);
    if (hPtr == NULL) {
	SdlTkUnlock(NULL);
	Tcl_SetResult(interp, "unknown joystick identifier", TCL_STATIC);
	return TCL_ERROR;
    }
    stick = (SDL_Joystick *) Tcl_GetHashValue(hPtr);
    switch (index) {
................................................................................

	if ((void *) new_sc != last_sc) {
	    last_sc = (void *) new_sc;
	    SdlTkSetSWCursor(new_sc);
	}
	return;
    }
    hPtr = Tcl_FindHashEntry(&SdlTkX.sdlcursors, INT2PTR(shape));
    if (hPtr == NULL) {
#ifndef __HAIKU__
	if (SdlTkX.is_framebuffer) {
	    const unsigned char *data, *mask;
	    int x, y;

	    data = SdlTkGetSystemCursorData(shape);
................................................................................
#endif
	sc = SDL_CreateSystemCursor(shape);
madeCursor:
	if (sc != NULL) {
	    int isNew;

	    hPtr = Tcl_CreateHashEntry(&SdlTkX.sdlcursors,
				       INT2PTR(shape), &isNew);
	    Tcl_SetHashValue(hPtr, (ClientData) sc);
	}
    } else {
	sc = (SDL_Cursor *) Tcl_GetHashValue(hPtr);
    }
    if (sc != NULL) {
	if ((void *) sc != last_sc) {

Changes to jni/sdl2tk/sdl/SdlTkUtils.c.

357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
...
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
...
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
    fterr = FT_Open_Face(ftlib, &ftarg, ffKey->index, &face);
    if (fterr != 0) {
	Tcl_Panic("loading freetype font failed");
    }
    FT_Select_Charmap(face, FT_ENCODING_UNICODE);
    charcode = FT_Get_First_Char(face, &gindex);
    while (gindex != 0) {
	hPtr = Tcl_CreateHashEntry(&ghash->hash,
				   (char *) charcode, &isNew);
	if (isNew) {
	    Tcl_SetHashValue(hPtr, (char *) charcode);
	}
	charcode = FT_Get_Next_Char(face, charcode, &gindex);
    }
    FT_Done_Face(face);
    FT_Done_FreeType(ftlib);
    ghash->hashLoaded = 1;
}
................................................................................

int
SdlTkFontHasChar(XFontStruct *fontStructPtr, char *buf)
{
    _Font *_f = (_Font *) fontStructPtr->fid;
    Tcl_HashEntry *hPtr;
    unsigned int ucs4 = ((unsigned int *) buf)[0];
    unsigned long lucs4 = ucs4;
    int ret = 0;

    Tcl_MutexLock(&fontMutex);
    hPtr = Tcl_FindHashEntry(&_f->glyphIndexHash->hash, (char *) lucs4);
    if (hPtr != NULL) {
	ret = (Tcl_GetHashValue(hPtr) != 0);
    }
    Tcl_MutexUnlock(&fontMutex);
    return ret;
}

int
SdlTkFontCanDisplayChar(char *xlfd, TkFontAttributes *faPtr, int ch)
{
    Tcl_HashSearch search;
    Tcl_HashEntry *hPtr, *hPtr2;
    unsigned long lch = ch;

    Tcl_MutexLock(&fontMutex);
    hPtr = Tcl_FirstHashEntry(&fileFaceHash, &search);
    while (hPtr != NULL) {
	GlyphIndexHash *ghash;

	ghash = (GlyphIndexHash *) Tcl_GetHashValue(hPtr);
................................................................................
	    }
	    if (!ghash->hashLoaded) {
	        FileFaceKey *ffKey;

		ffKey = (FileFaceKey *) Tcl_GetHashKey(&fileFaceHash, hPtr);
		SdlTkLoadGlyphHash(ghash, ffKey, 0);
	    }
	    hPtr2 = Tcl_FindHashEntry(&ghash->hash, (char *) lch);
	    Tcl_MutexUnlock(&fontMutex);
	    return (hPtr2 == NULL) ? 0 : 1;
	}
next:
	hPtr = Tcl_NextHashEntry(&search);
    }
    Tcl_MutexUnlock(&fontMutex);







|
<

|







 







<



|












<







 







|







357
358
359
360
361
362
363
364

365
366
367
368
369
370
371
372
373
...
519
520
521
522
523
524
525

526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541

542
543
544
545
546
547
548
...
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
    fterr = FT_Open_Face(ftlib, &ftarg, ffKey->index, &face);
    if (fterr != 0) {
	Tcl_Panic("loading freetype font failed");
    }
    FT_Select_Charmap(face, FT_ENCODING_UNICODE);
    charcode = FT_Get_First_Char(face, &gindex);
    while (gindex != 0) {
	hPtr = Tcl_CreateHashEntry(&ghash->hash, INT2PTR(charcode), &isNew);

	if (isNew) {
	    Tcl_SetHashValue(hPtr, INT2PTR(charcode));
	}
	charcode = FT_Get_Next_Char(face, charcode, &gindex);
    }
    FT_Done_Face(face);
    FT_Done_FreeType(ftlib);
    ghash->hashLoaded = 1;
}
................................................................................

int
SdlTkFontHasChar(XFontStruct *fontStructPtr, char *buf)
{
    _Font *_f = (_Font *) fontStructPtr->fid;
    Tcl_HashEntry *hPtr;
    unsigned int ucs4 = ((unsigned int *) buf)[0];

    int ret = 0;

    Tcl_MutexLock(&fontMutex);
    hPtr = Tcl_FindHashEntry(&_f->glyphIndexHash->hash, INT2PTR(ucs4));
    if (hPtr != NULL) {
	ret = (Tcl_GetHashValue(hPtr) != 0);
    }
    Tcl_MutexUnlock(&fontMutex);
    return ret;
}

int
SdlTkFontCanDisplayChar(char *xlfd, TkFontAttributes *faPtr, int ch)
{
    Tcl_HashSearch search;
    Tcl_HashEntry *hPtr, *hPtr2;


    Tcl_MutexLock(&fontMutex);
    hPtr = Tcl_FirstHashEntry(&fileFaceHash, &search);
    while (hPtr != NULL) {
	GlyphIndexHash *ghash;

	ghash = (GlyphIndexHash *) Tcl_GetHashValue(hPtr);
................................................................................
	    }
	    if (!ghash->hashLoaded) {
	        FileFaceKey *ffKey;

		ffKey = (FileFaceKey *) Tcl_GetHashKey(&fileFaceHash, hPtr);
		SdlTkLoadGlyphHash(ghash, ffKey, 0);
	    }
	    hPtr2 = Tcl_FindHashEntry(&ghash->hash, INT2PTR(ch));
	    Tcl_MutexUnlock(&fontMutex);
	    return (hPtr2 == NULL) ? 0 : 1;
	}
next:
	hPtr = Tcl_NextHashEntry(&search);
    }
    Tcl_MutexUnlock(&fontMutex);

Changes to jni/sdl2tk/sdl/agg-2.4/include/agg_path_storage.h.

716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
        void flip_y(double y1, double y2);

        // Concatenate path. The path is added as is.
        //--------------------------------------------------------------------
        template<class VertexSource> 
        void concat_path(VertexSource& vs, unsigned path_id = 0)
        {
            double x, y;
            unsigned cmd;
            vs.rewind(path_id);
            while(!is_stop(cmd = vs.vertex(&x, &y)))
            {
                m_vertices.add_vertex(x, y, cmd);
            }
        }







|







716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
        void flip_y(double y1, double y2);

        // Concatenate path. The path is added as is.
        //--------------------------------------------------------------------
        template<class VertexSource> 
        void concat_path(VertexSource& vs, unsigned path_id = 0)
        {
            double x = 0, y = 0;
            unsigned cmd;
            vs.rewind(path_id);
            while(!is_stop(cmd = vs.vertex(&x, &y)))
            {
                m_vertices.add_vertex(x, y, cmd);
            }
        }

Changes to jni/tcl/generic/tcl.h.

420
421
422
423
424
425
426
427
428
429
430
431
432




433
434
435
436
437
438
439
#   define Tcl_LongAsWide(val)		((long)(val))
#   define Tcl_WideAsDouble(val)	((double)((long)(val)))
#   define Tcl_DoubleAsWide(val)	((long)((double)(val)))
#   ifndef TCL_LL_MODIFIER
#      define TCL_LL_MODIFIER		"l"
#   endif /* !TCL_LL_MODIFIER */
#else /* TCL_WIDE_INT_IS_LONG */
/*
 * The next short section of defines are only done when not running on Windows
 * or some other strange platform.
 */
#   ifndef TCL_LL_MODIFIER
#      define TCL_LL_MODIFIER		"ll"




#   endif /* !TCL_LL_MODIFIER */
#   define Tcl_WideAsLong(val)		((long)((Tcl_WideInt)(val)))
#   define Tcl_LongAsWide(val)		((Tcl_WideInt)((long)(val)))
#   define Tcl_WideAsDouble(val)	((double)((Tcl_WideInt)(val)))
#   define Tcl_DoubleAsWide(val)	((Tcl_WideInt)((double)(val)))
#endif /* TCL_WIDE_INT_IS_LONG */








|
|
|
|
|
|
>
>
>
>







420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
#   define Tcl_LongAsWide(val)		((long)(val))
#   define Tcl_WideAsDouble(val)	((double)((long)(val)))
#   define Tcl_DoubleAsWide(val)	((long)((double)(val)))
#   ifndef TCL_LL_MODIFIER
#      define TCL_LL_MODIFIER		"l"
#   endif /* !TCL_LL_MODIFIER */
#else /* TCL_WIDE_INT_IS_LONG */
#   ifndef TCL_LL_MODIFIER
#      if defined(_WIN32)
#         ifdef __BORLANDC__
#            define TCL_LL_MODIFIER	"L"
#         else /* __BORLANDC__ */
#            define TCL_LL_MODIFIER	"I64"
#         endif /* __BORLANDC__ */
#      else
#         define TCL_LL_MODIFIER	"ll"
#      endif
#   endif /* !TCL_LL_MODIFIER */
#   define Tcl_WideAsLong(val)		((long)((Tcl_WideInt)(val)))
#   define Tcl_LongAsWide(val)		((Tcl_WideInt)((long)(val)))
#   define Tcl_WideAsDouble(val)	((double)((Tcl_WideInt)(val)))
#   define Tcl_DoubleAsWide(val)	((Tcl_WideInt)((double)(val)))
#endif /* TCL_WIDE_INT_IS_LONG */

Changes to jni/tcl/generic/zipfs.c.

46
47
48
49
50
51
52

53

54
55
56
57
58
59
60

#define ZIPFS_MEMLOAD 1

#include <sys/syscall.h>
#include <sys/utsname.h>
#include <dlfcn.h>


#define __NR_memfd_create 319


/* Wrapper to call memfd_create(2). */
static inline int
memfd_create(const char *name, unsigned int flags)
{
    return syscall(__NR_memfd_create, name, flags);
}







>

>







46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62

#define ZIPFS_MEMLOAD 1

#include <sys/syscall.h>
#include <sys/utsname.h>
#include <dlfcn.h>

#ifndef __NR_memfd_create
#define __NR_memfd_create 319
#endif

/* Wrapper to call memfd_create(2). */
static inline int
memfd_create(const char *name, unsigned int flags)
{
    return syscall(__NR_memfd_create, name, flags);
}

Changes to jni/tcl/win/tclWinDde.c.

1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
    DdeEnumServices *es;
    TCHAR sz[255];
    Tcl_DString dString;

#ifdef _WIN64
    es = (DdeEnumServices *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
#else
    es = (struct DdeEnumServices *) GetWindowLong(hwnd, GWL_USERDATA);
#endif

    if (((es->service == (ATOM)0) || (es->service == service))
	    && ((es->topic == (ATOM)0) || (es->topic == topic))) {
	Tcl_Obj *matchPtr = Tcl_NewListObj(0, NULL);
	Tcl_Obj *resultPtr = Tcl_GetObjResult(es->interp);








|







1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
    DdeEnumServices *es;
    TCHAR sz[255];
    Tcl_DString dString;

#ifdef _WIN64
    es = (DdeEnumServices *) GetWindowLongPtr(hwnd, GWLP_USERDATA);
#else
    es = (DdeEnumServices *) GetWindowLong(hwnd, GWL_USERDATA);
#endif

    if (((es->service == (ATOM)0) || (es->service == service))
	    && ((es->topic == (ATOM)0) || (es->topic == topic))) {
	Tcl_Obj *matchPtr = Tcl_NewListObj(0, NULL);
	Tcl_Obj *resultPtr = Tcl_GetObjResult(es->interp);

Changes to jni/tcl/win/tclWinPort.h.

506
507
508
509
510
511
512

513

514
515
516
517
518
519
520

#define	TCL_PLATFORM_TRANSLATION	TCL_TRANSLATE_CRLF

/*
 * Declare dynamic loading extension macro.
 */


#define TCL_SHLIB_EXT ".dll"


/*
 * The following define ensures that we use the native putenv
 * implementation to modify the environment array.  This keeps
 * the C level environment in synch with the system level environment.
 */








>

>







506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522

#define	TCL_PLATFORM_TRANSLATION	TCL_TRANSLATE_CRLF

/*
 * Declare dynamic loading extension macro.
 */

#ifndef TCL_SHLIB_EXT
#define TCL_SHLIB_EXT ".dll"
#endif

/*
 * The following define ensures that we use the native putenv
 * implementation to modify the environment array.  This keeps
 * the C level environment in synch with the system level environment.
 */

Changes to undroid/libwebsockets/test-server/test-server-http.c.

140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
	unsigned char *end, *start;
	struct timeval tv;
	unsigned char *p;
#ifndef LWS_NO_CLIENT
	struct per_session_data__http *pss1;
	struct lws *wsi1;
#endif
	char buf[256];
	char b64[64];
	int n, m;
#ifdef EXTERNAL_POLL
	struct lws_pollargs *pa = (struct lws_pollargs *)in;
#endif









|







140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
	unsigned char *end, *start;
	struct timeval tv;
	unsigned char *p;
#ifndef LWS_NO_CLIENT
	struct per_session_data__http *pss1;
	struct lws *wsi1;
#endif
	char buf[512];
	char b64[64];
	int n, m;
#ifdef EXTERNAL_POLL
	struct lws_pollargs *pa = (struct lws_pollargs *)in;
#endif


Changes to undroid/snap7/src/core/s7_server.cpp.

1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
}
//==============================================================================
// FUNCTION SZL
//==============================================================================
void TS7Worker::SZLNotAvailable()
{
    SZL.Answer.Header.DataLen=SwapWord(sizeof(SZLNotAvail));
	SZL.ResParams->Err = 0x02D4;
    memcpy(SZL.ResData, &SZLNotAvail, sizeof(SZLNotAvail));
    isoSendBuffer(&SZL.Answer,26);
    SZL.SZLDone=false;
}
void TS7Worker::SZLSystemState()
{
    SZL.Answer.Header.DataLen=SwapWord(sizeof(SZLSysState));
    SZL.ResParams->Err =0x0000;
    memcpy(SZL.ResData,&SZLNotAvail,sizeof(SZLSysState));
    isoSendBuffer(&SZL.Answer,28);
	SZL.SZLDone=true;

}
void TS7Worker::SZLData(void *P, int len)
{
	int MaxSzl=FPDULength-22;

	if (len>MaxSzl) {
		len=MaxSzl;







|








|

|
<







1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254

1255
1256
1257
1258
1259
1260
1261
}
//==============================================================================
// FUNCTION SZL
//==============================================================================
void TS7Worker::SZLNotAvailable()
{
    SZL.Answer.Header.DataLen=SwapWord(sizeof(SZLNotAvail));
    SZL.ResParams->Err = 0x02D4;
    memcpy(SZL.ResData, &SZLNotAvail, sizeof(SZLNotAvail));
    isoSendBuffer(&SZL.Answer,26);
    SZL.SZLDone=false;
}
void TS7Worker::SZLSystemState()
{
    SZL.Answer.Header.DataLen=SwapWord(sizeof(SZLSysState));
    SZL.ResParams->Err =0x0000;
    memcpy(SZL.ResData,&SZLSysState,sizeof(SZLSysState));
    isoSendBuffer(&SZL.Answer,28);
    SZL.SZLDone=true;

}
void TS7Worker::SZLData(void *P, int len)
{
	int MaxSzl=FPDULength-22;

	if (len>MaxSzl) {
		len=MaxSzl;

Changes to undroid/tkvlc/generic/tkvlc.c.

390
391
392
393
394
395
396
397
398
399
400
401
402
403
404

static void libVLChandler(const struct libvlc_event_t *ev, void *clientData)
{
  libVLCData *p = (libVLCData *) clientData;
  libVLCEvent *e;
  int type;

  if (p->exit_called == NULL) {
    return;
  }
  if (p->media_player == NULL) {
    return;
  }
  switch (ev->type) {
    case libvlc_MediaPlayerMediaChanged:







|







390
391
392
393
394
395
396
397
398
399
400
401
402
403
404

static void libVLChandler(const struct libvlc_event_t *ev, void *clientData)
{
  libVLCData *p = (libVLCData *) clientData;
  libVLCEvent *e;
  int type;

  if (p->exit_called) {
    return;
  }
  if (p->media_player == NULL) {
    return;
  }
  switch (ev->type) {
    case libvlc_MediaPlayerMediaChanged:

Changes to undroid/tserialport/libserialport/linux.c.

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
	 */
	char description[128];
	int bus, address;
	unsigned int vid, pid;
	char manufacturer[128], product[128], serial[128];
	char baddr[32];
	const char dir_name[] = "/sys/class/tty/%s/device/%s%s";
	char sub_dir[32] = "", file_name[PATH_MAX];
	char *ptr, *dev = port->name + 5;
	FILE *file;
	int i, count;
	struct stat statbuf;

	if (strncmp(port->name, "/dev/", 5))
		RETURN_ERROR(SP_ERR_ARG, "Device name not recognized");

	snprintf(file_name, sizeof(file_name), "/sys/class/tty/%s", dev);
	if (lstat(file_name, &statbuf) == -1)
		RETURN_ERROR(SP_ERR_ARG, "Device not found");
	if (!S_ISLNK(statbuf.st_mode))
		snprintf(file_name, sizeof(file_name), "/sys/class/tty/%s/device", dev);
	count = readlink(file_name, file_name, sizeof(file_name));
	if (count <= 0 || count >= (int)(sizeof(file_name) - 1))
		RETURN_ERROR(SP_ERR_ARG, "Device not found");
	file_name[count] = 0;
	if (strstr(file_name, "bluetooth"))
		port->transport = SP_TRANSPORT_BLUETOOTH;
	else if (strstr(file_name, "usb"))
		port->transport = SP_TRANSPORT_USB;







|








|
|


|
|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
	 */
	char description[128];
	int bus, address;
	unsigned int vid, pid;
	char manufacturer[128], product[128], serial[128];
	char baddr[32];
	const char dir_name[] = "/sys/class/tty/%s/device/%s%s";
	char sub_dir[32] = "", file_name0[PATH_MAX], file_name[PATH_MAX];
	char *ptr, *dev = port->name + 5;
	FILE *file;
	int i, count;
	struct stat statbuf;

	if (strncmp(port->name, "/dev/", 5))
		RETURN_ERROR(SP_ERR_ARG, "Device name not recognized");

	snprintf(file_name0, sizeof(file_name0), "/sys/class/tty/%s", dev);
	if (lstat(file_name0, &statbuf) == -1)
		RETURN_ERROR(SP_ERR_ARG, "Device not found");
	if (!S_ISLNK(statbuf.st_mode))
		snprintf(file_name0, sizeof(file_name0), "/sys/class/tty/%s/device", dev);
	count = readlink(file_name0, file_name, sizeof(file_name));
	if (count <= 0 || count >= (int)(sizeof(file_name) - 1))
		RETURN_ERROR(SP_ERR_ARG, "Device not found");
	file_name[count] = 0;
	if (strstr(file_name, "bluetooth"))
		port->transport = SP_TRANSPORT_BLUETOOTH;
	else if (strstr(file_name, "usb"))
		port->transport = SP_TRANSPORT_USB;