metamod-hl1 icon indicating copy to clipboard operation
metamod-hl1 copied to clipboard

Unwanted 'const' in meta_api.h?

Open APGRoboCop opened this issue 7 years ago • 3 comments

Is it just me or is that 'const' should be removed? It seems to not have it on the Metamod-P src version. When I removed those 'const' from meta_api.h starting in line 134, it appears to allow my compiler for GCC 4.8 work.

C_DLLEXPORT int Meta_Query(const char *interfaceVersion, plugin_info_t **plinfo, mutil_funcs_t *pMetaUtilFuncs); typedef int (*META_QUERY_FN) (const char *interfaceVersion, plugin_info_t **plinfo, mutil_funcs_t *pMetaUtilFuncs);

APGRoboCop avatar Mar 01 '18 21:03 APGRoboCop

Is this for a plugin? The docs say Meta_Query's signature should be non-const, but in the code it's internally consistent and the string really is const.

dvander avatar Mar 03 '18 23:03 dvander

Yes that header file is for a Metamod plugin.

⁣Sent from BlueMail ​

On 3 Mar 2018, 23:41, at 23:41, David Anderson [email protected] wrote:

Is this for a plugin? The docs say Meta_Query's signature should be non-const, but in the code it's internally consistent and the string really is const.

-- You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub: https://github.com/alliedmodders/metamod-hl1/issues/6#issuecomment-370188836

APGRoboCop avatar Mar 04 '18 01:03 APGRoboCop

We const-qualified these to avoid compiler warnings. You could try to get the same changes upstreamed to metamod-p. Since they are supposed to be ABI compatible it shouldn't matter, you can build your plugin against either.

dvander avatar Mar 04 '18 03:03 dvander