Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/osfree-project/osfree
Browse files Browse the repository at this point in the history
  • Loading branch information
valerius2k committed May 16, 2022
2 parents c6d500b + f3d645a commit 5b985ac
Show file tree
Hide file tree
Showing 33 changed files with 12,260 additions and 1,904 deletions.
43 changes: 0 additions & 43 deletions DOS/WIN16/commdlg/Makefile

This file was deleted.

2 changes: 1 addition & 1 deletion DOS/WIN16/programs/progman/makefile
Expand Up @@ -10,7 +10,7 @@ DESC = Windows Program Manager
srcfiles = $(p)dialog$(e) $(p)group$(e) $(p)grpfile$(e) $(p)main$(e) $(p)program$(e) $(p)string$(e)

# defines additional options for C compiler
ADD_COPT = -zW -sg -zw -bw -bg -d3 -db -hw
ADD_COPT = -zW -sg -zw -bw -bg -d3 -db -hw -ml
#DEBUG = watcom
IMPORTS = GETOPENFILENAME COMMDLG.1, &
GETCURRENTDIRECTORY WINSMSG.20
Expand Down
2 changes: 1 addition & 1 deletion DOS/WIN16/samples/apidemo/makefile
Expand Up @@ -10,6 +10,6 @@ DESC = Simple Windows Application
#defines object file names in format objname.$(O)
srcfiles = $(p)MsgCode$(e) $(p)windemo$(e)
# defines additional options for C compiler
ADD_COPT = -zW
ADD_COPT = -zW -ml

!include $(%ROOT)/mk/appsw16.mk
1 change: 1 addition & 0 deletions DOS/WIN16/samples/apidemo/windemo.c
Expand Up @@ -22,6 +22,7 @@
#include <windows.h>

#include <stdlib.h>
#include <string.h>
/*
** Private Includes
*/
Expand Down
1 change: 1 addition & 0 deletions OS2/Shared/libs/libvorbis/lib/dll/makefile
Expand Up @@ -15,6 +15,7 @@ srcfiles = &
$(p)..$(SEP)lookup$(e) $(p)..$(SEP)bitrate$(e) $(p)..$(SEP)vorbisfile$(e) $(p)..$(SEP)vorbisenc$(e) $(p)..$(SEP)porting$(e)

DLL = 1
NOLIBS = 1
DLLOPT = initinstance
#STACKSIZE = 0xa0000000
IMPORTS = &
Expand Down
21 changes: 14 additions & 7 deletions OS2/Shared/libs/zlib/adler32.c
@@ -1,17 +1,15 @@
/* adler32.c -- compute the Adler-32 checksum of a data stream
* Copyright (C) 1995-2011 Mark Adler
* Copyright (C) 1995-2011, 2016 Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/

/* @(#) $Id$ */

#include "zutil.h"

#define local static

local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));

#define BASE 65521 /* largest prime smaller than 65536 */
#define BASE 65521U /* largest prime smaller than 65536 */
#define NMAX 5552
/* NMAX is the largest n such that 255n(n+1)/2 + (n+1)(BASE-1) <= 2^32-1 */

Expand Down Expand Up @@ -62,10 +60,10 @@ local uLong adler32_combine_ OF((uLong adler1, uLong adler2, z_off64_t len2));
#endif

/* ========================================================================= */
uLong ZEXPORT adler32(adler, buf, len)
uLong ZEXPORT adler32_z(adler, buf, len)
uLong adler;
const Bytef *buf;
uInt len;
z_size_t len;
{
unsigned long sum2;
unsigned n;
Expand Down Expand Up @@ -132,6 +130,15 @@ uLong ZEXPORT adler32(adler, buf, len)
return adler | (sum2 << 16);
}

/* ========================================================================= */
uLong ZEXPORT adler32(adler, buf, len)
uLong adler;
const Bytef *buf;
uInt len;
{
return adler32_z(adler, buf, len);
}

/* ========================================================================= */
local uLong adler32_combine_(adler1, adler2, len2)
uLong adler1;
Expand All @@ -156,7 +163,7 @@ local uLong adler32_combine_(adler1, adler2, len2)
sum2 += ((adler1 >> 16) & 0xffff) + ((adler2 >> 16) & 0xffff) + BASE - rem;
if (sum1 >= BASE) sum1 -= BASE;
if (sum1 >= BASE) sum1 -= BASE;
if (sum2 >= (BASE << 1)) sum2 -= (BASE << 1);
if (sum2 >= ((unsigned long)BASE << 1)) sum2 -= ((unsigned long)BASE << 1);
if (sum2 >= BASE) sum2 -= BASE;
return sum1 | (sum2 << 16);
}
Expand Down
42 changes: 24 additions & 18 deletions OS2/Shared/libs/zlib/compress.c
@@ -1,5 +1,5 @@
/* compress.c -- compress a memory buffer
* Copyright (C) 1995-2005 Jean-loup Gailly.
* Copyright (C) 1995-2005, 2014, 2016 Jean-loup Gailly, Mark Adler
* For conditions of distribution and use, see copyright notice in zlib.h
*/

Expand Down Expand Up @@ -28,16 +28,11 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
{
z_stream stream;
int err;
const uInt max = (uInt)-1;
uLong left;

stream.next_in = (z_const Bytef *)source;
stream.avail_in = (uInt)sourceLen;
#ifdef MAXSEG_64K
/* Check for source > 64K on 16-bit machine: */
if ((uLong)stream.avail_in != sourceLen) return Z_BUF_ERROR;
#endif
stream.next_out = dest;
stream.avail_out = (uInt)*destLen;
if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR;
left = *destLen;
*destLen = 0;

stream.zalloc = (alloc_func)0;
stream.zfree = (free_func)0;
Expand All @@ -46,15 +41,26 @@ int ZEXPORT compress2 (dest, destLen, source, sourceLen, level)
err = deflateInit(&stream, level);
if (err != Z_OK) return err;

err = deflate(&stream, Z_FINISH);
if (err != Z_STREAM_END) {
deflateEnd(&stream);
return err == Z_OK ? Z_BUF_ERROR : err;
}
*destLen = stream.total_out;
stream.next_out = dest;
stream.avail_out = 0;
stream.next_in = (z_const Bytef *)source;
stream.avail_in = 0;

do {
if (stream.avail_out == 0) {
stream.avail_out = left > (uLong)max ? max : (uInt)left;
left -= stream.avail_out;
}
if (stream.avail_in == 0) {
stream.avail_in = sourceLen > (uLong)max ? max : (uInt)sourceLen;
sourceLen -= stream.avail_in;
}
err = deflate(&stream, sourceLen ? Z_NO_FLUSH : Z_FINISH);
} while (err == Z_OK);

err = deflateEnd(&stream);
return err;
*destLen = stream.total_out;
deflateEnd(&stream);
return err == Z_STREAM_END ? Z_OK : err;
}

/* ===========================================================================
Expand Down

0 comments on commit 5b985ac

Please sign in to comment.