Raised This Month: $32 Target: $400
 8% 

warning 201: redefinition of constant/macro (symbol "MAX_PLAYERS")


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
.:cs.stambeto:.
Senior Member
Join Date: Feb 2010
Location: Bulgaria
Old 01-20-2015 , 09:10   warning 201: redefinition of constant/macro (symbol "MAX_PLAYERS")
Reply With Quote #1

How to fix this error in amxmodx 1.8.3.

xredirect.sma(27) : warning 201: redefinition of constant/macro (symbol "MAX_PLAYERS")



PHP Code:
#define MAX_PLAYERS 32 
Attached Files
File Type: sma Get Plugin or Get Source (xredirect.sma - 1076 views - 84.4 KB)

Last edited by .:cs.stambeto:.; 01-20-2015 at 09:47.
.:cs.stambeto:. is offline
bat
Veteran Member
Join Date: Jul 2012
Old 01-20-2015 , 09:50   Re: warning 201: redefinition of constant/macro (symbol "MAX_PLAYERS")
Reply With Quote #2

Quote:
Originally Posted by .:cs.stambeto:. View Post
How to fix this error in amxmodx 1.8.3.

xredirect.sma(23) : warning 201: redefinition of constant/macro (symbol "MAX_PLAYERS")



PHP Code:
#define MAX_PLAYERS 32 
Because AmxModx 1.8.3 already have include definition MAX_PLAYERS Just delete "#define MAX_PLAYERS of code"
__________________
bat is offline
Send a message via Skype™ to bat
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-20-2015 , 09:50   Re: warning 201: redefinition of constant/macro (symbol "MAX_PLAYERS")
Reply With Quote #3

This is not an error, but just a warning.

In 1.8.3-dev, MAX_PLAYERS has been included as constants to value 33 for convenience, because it's always used this way to declare an array.

This warning just tells you the plugin has redefined MAX_PLAYERS.
Plugin is still compiled and it will work the same.


If you still want remove this warning, you can either remove line in code where it defines MAX_PLAYERS, or renaming any occurrences of MAX_PLAYERS to for example MAXPLAYERS.
__________________
Arkshine is offline
.:cs.stambeto:.
Senior Member
Join Date: Feb 2010
Location: Bulgaria
Old 01-20-2015 , 09:59   Re: warning 201: redefinition of constant/macro (symbol "MAX_PLAYERS")
Reply With Quote #4

When you delete this line receive these errors.

PHP Code:
redirect.sma(584) : error 047: array sizes do not match, or destination array is too small
xredirect
.sma(707) : error 047: array sizes do not match, or destination array is too small
xredirect
.sma(720) : error 047: array sizes do not match, or destination array is too small
xredirect
.sma(1239) : error 047: array sizes do not match, or destination array is too small
xredirect
.sma(1778) : error 047: array sizes do not match, or destination array is too small
xredirect
.sma(1860) : error 047: array sizes do not match, or destination array is too small
xredirect
.sma(1901) : error 047: array sizes do not match, or destination array is too small
xredirect
.sma(1961) : error 047: array sizes do not match, or destination array is too small 

I tried to do 33 but still out these errors.
Attached Files
File Type: sma Get Plugin or Get Source (xredirect.sma - 1070 views - 84.0 KB)

Last edited by .:cs.stambeto:.; 01-20-2015 at 10:03.
.:cs.stambeto:. is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 01-20-2015 , 10:23   Re: warning 201: redefinition of constant/macro (symbol "MAX_PLAYERS")
Reply With Quote #5

Because author has decided to stick with arrays of 32 everywhere. Fastest solution would be to simply ignore this warning (I say it again, plugin still compiles and works fine with it) or renaming the define by using a text editor and doing a replace-all.
__________________

Last edited by Arkshine; 01-20-2015 at 10:25.
Arkshine is offline
.:cs.stambeto:.
Senior Member
Join Date: Feb 2010
Location: Bulgaria
Old 01-20-2015 , 10:41   Re: warning 201: redefinition of constant/macro (symbol "MAX_PLAYERS")
Reply With Quote #6

Well, can you fix it not to see this warning.
.:cs.stambeto:. is offline
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 01-20-2015 , 11:23   Re: warning 201: redefinition of constant/macro (symbol "MAX_PLAYERS")
Reply With Quote #7

Just change all of this:
Code:
MAX_PLAYERS
-->
Code:
MAXPLAYERS
zmd94 is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 01-20-2015 , 11:55   Re: warning 201: redefinition of constant/macro (symbol "MAX_PLAYERS")
Reply With Quote #8

If yr using amxmodx studio just press ctrl+r for replacement!

Last edited by Natsheh; 01-20-2015 at 11:56.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
.:cs.stambeto:.
Senior Member
Join Date: Feb 2010
Location: Bulgaria
Old 01-20-2015 , 12:06   Re: warning 201: redefinition of constant/macro (symbol "MAX_PLAYERS")
Reply With Quote #9

Well it do so right:


#define MAX_PLAYERS 32

---->

#define MAXPLAYERS 32
.:cs.stambeto:. is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 23:52.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode