Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeex committed Feb 8, 2020
2 parents c565a5d + 4ede5aa commit a8e7f0a
Show file tree
Hide file tree
Showing 58 changed files with 3,726 additions and 818 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ deploy:
secure: gDAuRNlF2uVhVHyZtJrX6MwNxnkfkQzohrC/6UcKAgqt+NKs4vZyq5FzTUceiDAkB0se70ZVx08e9ibAiXP/b7D1MPkAEiRxt9J6Vu3x6Bi1kPPuK5RfjFeT3gc1SbrULAP8Nz0NdU0chUhei6/V5NGhTegwp925DJOISq7+Ibw=
file_glob: true
file:
- 'build/pawnc-*-linux.tar.gz'
- 'build/pawnc-*-macos.zip'
- 'pawnc-*-linux.tar.gz'
- 'pawnc-*-macos.zip'
draft: true
skip_cleanup: true
on:
Expand Down
18 changes: 12 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ This project exists to:
- Fix known bugs with the original compiler
- Provide a better development experience for the SA:MP community

If you find problem, you can [open an issue][issues] and contributors can work
If you find a problem, you can [open an issue][issues] and contributors can work
on a fix. This isn't true with the original compiler that comes with the SA:MP
server distribution.

Expand Down Expand Up @@ -62,20 +62,26 @@ Download the ZIP archive and extract `pawnc.dll`, `pawncc.exe`,
`pawndisasmsm.exe` to your original `pawncc` directory. If you use Pawno, this
will be in the `pawno/` folder that's inside your server directory.

### openSUSE/SLES
### openSUSE

There is an installation package available for openSUSE/SLES users so that you
can easily install the compiler on your distribution. Please follow these steps:
There is an installation package available for openSUSE users so that you
can easily install the latest compiler on your distribution. Please follow
these steps:

1. Go to <https://build.opensuse.org/package/show/home:mschnitzer/pawncc>
1. Go to https://build.opensuse.org/package/show/home:mschnitzer:pawncc/pawncc
2. On the right side, select your distribution (only if it's not disabled!)
3. Click "Go to download repository"
4. Copy the link and enter in sudo mode in your shell:
`zypper ar $COPIED_LINK home:mschnitzer`
`zypper ar $COPIED_LINK home:mschnitzer:pawncc`
5. Again as root, type: `zypper ref`
6. Install the package with `zypper in pawncc`
7. Run `pawncc` in your shell to test if it's working

The download repository for openSUSE does provide older versions as well (oldest
version: 3.10.7). Just install the version you like (e.g.:
`zypper in pawncc-3.10.8` and run it via `$ pawncc-3.10.8 -Z -O3 [...]`).
Parallel installation is supported.

### With sampctl

If you are a [sampctl][sampctl] user, you are already using this compiler!
Expand Down
9 changes: 3 additions & 6 deletions source/compiler/memfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,11 @@ int memfile_write(memfile_t *mf, const void *buffer, size_t size)
assert(buffer != NULL);
if (mf->offs + size > mf->size)
{
char *orgbase = mf->base; /* save, in case realloc() fails */
size_t newsize = (mf->size + size) * 2;
mf->base = (char *)realloc(mf->base, newsize);
if (!mf->base)
{
mf->base = orgbase; /* restore old pointer to avoid a memory leak */
char *newbase = (char *)realloc(mf->base, newsize);
if (!newbase)
return 0;
}
mf->base = newbase;
mf->size = newsize;
}
memcpy(mf->base + mf->offs, buffer, size);
Expand Down
Loading

0 comments on commit a8e7f0a

Please sign in to comment.