Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad example in sm.alliedmods.net/new-api/ #523

Open
ambaca opened this issue Sep 14, 2020 · 3 comments
Open

Bad example in sm.alliedmods.net/new-api/ #523

ambaca opened this issue Sep 14, 2020 · 3 comments

Comments

@ambaca
Copy link

ambaca commented Sep 14, 2020

On this page, using NormalSHook
https://sm.alliedmods.net/new-api/sdktools_sound/NormalSHook

function Action(int clients[], int& numClients, char sample[], int& entity, int& channel, float& volume, int& level, int& pitch, int& flags, char soundEntry[], int& seed)

Using these callback parameters, you get error when compile.

test.sp(6) : error 100: function prototypes do not match
test.sp(9) : error 159: brackets after variable name indicate a fixed-size array, but size could not be determined - either specify sizes, an array initializer, or use dynamic syntax (such as 'char[] x')
test.sp(9) : error 159: brackets after variable name indicate a fixed-size array, but size could not be determined - either specify sizes, an array initializer, or use dynamic syntax (such as 'char[] x')
test.sp(9) : error 159: brackets after variable name indicate a fixed-size array, but size could not be determined - either specify sizes, an array initializer, or use dynamic syntax (such as 'char[] x')
test.sp(9) : fatal error 190: too many error messages on one line

Need to look from file
https://sm.alliedmods.net/new-api/sdktools_sound/__raw

And get right one:

function Action (int clients[MAXPLAYERS], int &numClients, char sample[PLATFORM_MAX_PATH],
	  int &entity, int &channel, float &volume, int &level, int &pitch, int &flags,
	  char soundEntry[PLATFORM_MAX_PATH], int &seed)
@Fyren
Copy link
Contributor

Fyren commented Sep 14, 2020

I missed your issue issue earlier this year about this, but the problem is the code that generates the API pages doesn't parse and show the array sizes (among other things, like default parameters). It's been a known issue for, uh, maybe years now. I'm going to close your other one and edit this one's title into one about the mis-parsing/displaying.

@SlidyBat
Copy link
Contributor

I've fixed a lot of the docgen issues in a fork of mine for https://sourcemod.dev: https://github.com/SlidyBat/sourcepawn/tree/enum-struct-docgen
This issue is fixed in this commit: SlidyBat@23a0869
Planning on PRing in some of those changes soon.

@ambaca
Copy link
Author

ambaca commented Sep 14, 2020

I have totally forget, I had made this issue before :D Sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants