292 Commits

Author SHA1 Message Date
Zeex
9a98259251 Add headers to CMakeLists.txt 2017-01-21 14:33:18 +06:00
Zeex
6a3ab7c9f4 Merge branch 'pr-128' (#128)
Fixes #119, #125.
2017-01-17 23:43:38 +06:00
Zeex
9d8c1c55c5 Minor style fixes 2017-01-17 23:32:18 +06:00
Yashas
b13928c584 moved a declaration to the start of block
Abiding by the C89 declaration rules so that AppVeyor build can succeed.
2017-01-14 20:10:56 +05:30
Yashas
fa86f8f6cb fixed indentation 2017-01-14 19:34:22 +05:30
Yashas
602178a0b5 public variables behaviour
stops unused warnings from being triggered for public variables
2016-12-26 21:30:32 +05:30
Yashas
111785e767 public variables behaviour
1. 'stock' public (or public const) variables will be written to the file IF AND ONLY IF it has been used (read or write)
2. 'non-stock' public (or public const) variables will always be written to the file (whether or not it has been used)
3. public variables (or public const) NEVER ever trigger unused symbol warnings
2016-12-26 21:27:40 +05:30
Yashas
3234a29eb1 allow negative numbers in #emit 2016-12-26 17:40:36 +05:30
Zeex
1697d6f8b5 Merge pull request #121 from ziggi/recursion
Recursion
2016-11-14 01:32:17 +07:00
Sergei Marochkin
1a608c25a1 Add -R param to enable or disable recursion report 2016-11-11 19:27:09 +03:00
Sergei Marochkin
56ef450a24 Add detailed recursion report with call chains
Applied path from https://github.com/Zeex/pawn/tree/recursion branch.

Example:

f1() {
	f2();
}

f2() {
	f3();
}

f3() {
	f4();
}

f4() {
	f1();
}

will output:

recursion detected: function f1 indirectly calls itself:
f1 <- f4 <- f3 <- f2 <- f1
recursion detected: function f2 indirectly calls itself:
f2 <- f1 <- f4 <- f3 <- f2
recursion detected: function f3 indirectly calls itself:
f3 <- f2 <- f1 <- f4 <- f3
recursion detected: function f4 indirectly calls itself:
f4 <- f3 <- f2 <- f1 <- f4
2016-10-25 06:32:03 +03:00
Zeex
a0f4a4dce8 Build with RelWithDebInfo configuration on Travis 20160907 2016-09-07 21:41:08 +06:00
Zeex
51a384a583 Merge pull request #115 from ziggi/linuxfix
Remove Linux crash lines (#64, #114)
2016-09-07 21:20:29 +07:00
Sergei Marochkin
485361acb4 Revert and fix it (thanks to @oscar-broman) 2016-09-07 09:44:08 +03:00
Sergei Marochkin
b5959fcf15 Remove Linux crash lines 2016-09-05 11:16:56 +03:00
Zeex
85accfdf15 Draft pls 2016-08-31 11:56:23 +06:00
Zeex
0f7c56e34c Add support for OS X builds on Travis CI 2016-07-03 03:11:44 +06:00
Zeex
c6bc673ec9 AppVeyor can't do tags 2016-07-03 02:27:45 +06:00
Zeex
ffd4d9e98f Fix unused chdir() result value warning 2016-07-03 02:16:49 +06:00
Zeex
66830c8786 Set up AppVeyor deployment to GitHub Releases 2016-07-03 02:00:36 +06:00
Zeex
128a548f28 Set up Travis CI upload to GitHub Releases 2016-07-03 01:41:09 +06:00
Zeex
839cf52206 Fix missing #include <unistd.h> on Linux 20160702 2016-07-02 19:59:26 +06:00
Zeex
82ca375152 Open options file in binary mode
This fixes a gcc compile warning introduced by commit 1b0feaf3.
2016-07-02 19:57:46 +06:00
Zeex
48800fc738 Revert "Remove dubious file size check"
This reverts commit 1b0feaf380e1714ec3c15d10872b7861e420b5d0.
2016-07-02 19:44:12 +06:00
Zeex
1b0feaf380 Remove dubious file size check
As the comment right above those lines states, fread() may return a value
less than the actual file size beacuse of text conversion done by the
system. So why do it?

This fixes a bug on Windows where the compiler couldn't read the contents
of pawn.cfg because of this check. Interestingly enough, it could read the
source files just fine.

Fixes #90
2016-07-02 11:57:48 +06:00
Zeex
01609471e1 Fix inpfname being used before initialized 2016-07-02 11:52:38 +06:00
Zeex
036fd4f4c8 Don't set uWRITTEN flag for functions referenced from #emit
uWRITTEN == uRETVALUE, so marking a function symbol as written causes a
false "should return a value" warning.

Fixes #97
2016-07-02 11:04:05 +06:00
Zeex
6b2119f974 Always insert a newline at the end of file
Fixes #104
2016-07-02 10:29:16 +06:00
Zeex
632ab70605 Make -D option available on all platforms
Fixes #80
2016-01-10 14:31:30 +06:00
Zeex
b261bacfa4 Revert "Fix error when static/stock/public constant used as array size"
This reverts commit 39828f23f2967e78a2f0f981cbfa81e777adbef7.

Conflicts:
	source/compiler/sc1.c
2015-06-23 21:44:02 +06:00
Zeex
d8f824357f Don't remove unused public variables
But still warn about them unless they are marked as stock.

Fixes #71
2015-06-20 16:58:11 +06:00
Zeex
88f78aa882 Don't declare public constants as constants
Public constants must be declared as variables, like it was done
before the previous commit, because they must be visible by the
amx_XXXPubVar API.
2015-06-20 10:01:37 +06:00
Zeex
39828f23f2 Fix error when static/stock/public constant used as array size
Fixes #70

--------- test code --------

native printf(const format[], ...);

static const a = 1;
static stock const b = 2;
stock const c = 3;
public const d = 4;

main() {
	static const e = 5;
	new aa[a];
	new ab[b];
	new ac[c];
	new ad[d];
	new ae[e];
	printf("%d", sizeof(aa), aa);
	printf("%d", sizeof(ab), ab);
	printf("%d", sizeof(ac), ac);
	printf("%d", sizeof(ad), ad);
	printf("%d", sizeof(ae), ae);
}

----- end of test code -----
2015-06-19 21:49:40 +06:00
Zeex
1cca8af0d2 Fix indirection vector calculation
It was broken in commit d14f4870a8069ca446c0528a39b75e7d081ba3d5.

Fixes #63
20150531
2015-05-09 13:00:16 +06:00
Zeex
56262f42cd Fix compile warning 20150503 2015-05-03 01:34:00 +06:00
Zeex
d14f4870a8 Fix 4d array initialization
adjust_indirectiontables() generated wrong values for certain array
dimensions in 4d arrays.

Fixes #43
2015-05-01 16:16:59 +06:00
Zeex
10a021b51e Tiny consistency fix 2015-05-01 09:40:40 +06:00
Zeex
3594c6170d Fix previous fix 2015-04-26 02:06:06 +06:00
Zeex
85f849ba08 Fix symbol nesting level not remembered for 2d+ arrays
This fixes a bug where defining a 2d+ array variable in different
blocks at the same nesting level would trigger a symbol redefinition
error. For example:

main() {
	new x;

	if (x) {
		new a[10][11];
	} else {
		new a[10][12]; // error 021: symbol already defined: "a"
	}
}

It turned out that the compiler defines a separate symbol for each
of the array dimensions but it only was setting sym->compound for the
first of them, causing delete_symbols() to not delete the remaining
dimension symbols. Now it sets the compound field for all dimensions.

Fixes #60
2015-04-25 15:49:10 +06:00
Zeex
6e8bdc7438 Allow 4-dimensional arrays (experimental)
Refs #43
2015-04-13 12:23:39 +06:00
Zeex
25c7f33a73 Minor libpawn.rc fix
Be consistent with the rest of .rc files.
2015-04-13 12:14:56 +06:00
Zeex
09b97686cf Remove '.samp' from version string
Now that we have a different minor version that seems unnecessary.
20150412
2015-04-12 22:21:13 +06:00
Zeex
9191803370 Set version to 3.10
Now it's consistent with the __Pawn constant (0x030A == 3.10).
2015-04-12 21:25:10 +06:00
Zeex
add2c2b7e7 Generate packages with CPack 2015-04-12 19:57:03 +06:00
Zeex
a33ebc7b4b Add install rules
Now it's possible to run 'make install' to install binaries on your
system.

This also should resolve the deafult.inc & rpath problem (#54) as
CMake seems to remove rpath from binaries during installation.
2015-04-12 19:56:59 +06:00
Zeex
9422a5b946 Shorten artifact names to fit on page 2015-04-12 15:34:22 +06:00
Zeex
669aef06ef Remove remaining string expansion business from optimizer
This makes optimization work again.

Fixed #56
2015-04-11 22:48:52 +06:00
Zeex
1d7a961dc6 Add .pdb files to artifacts 2015-04-07 22:37:06 +06:00
Zeex
9036614bcb Fix broken 2d ellipsis after another array fix
Some tests would really help I guess...

See commit 7314b56.
pawncc-20150407
2015-04-07 22:15:53 +06:00
Zeex
13f98d5934 CMake cleanup 2015-04-07 19:26:10 +06:00