Fixed compiler bug where #pragma deprecated would emit a warning twice for stocks
Fixed compiler bug where #pragma deprecated would emit a warning twice for stocks
1.1 --- a/sourcepawn/compiler/sc1.c Mon Aug 06 00:22:38 2007 +0000
1.2 +++ b/sourcepawn/compiler/sc1.c Mon Aug 06 22:26:28 2007 +0000
1.3 @@ -3860,10 +3860,6 @@
1.4 */
1.5 if (fnative) {
1.6 if (opertok!=0) {
1.7 - if (matchtoken('['))
1.8 - {
1.9 - printf("Hrm!\n");
1.10 - }
1.11 needtoken('=');
1.12 lexpush(); /* push back, for matchtoken() to retrieve again */
1.13 } /* if */
1.14 @@ -4022,7 +4018,7 @@
1.15 cidx=code_idx;
1.16 glbdecl=glb_declared;
1.17 } /* if */
1.18 - if ((sym->flags & flgDEPRECATED)!=0) {
1.19 + if ((sym->flags & flgDEPRECATED) != 0 && (sym->usage & uSTOCK) == 0) {
1.20 char *ptr= (sym->documentation!=NULL) ? sym->documentation : "";
1.21 error(234,symbolname,ptr); /* deprecated (probably a public function) */
1.22 } /* if */
1.23 @@ -5659,7 +5655,7 @@
1.24 * In the case a "simple assignment" operator ("=") is used within a test,
1.25 * the warning "possibly unintended assignment" is displayed. This routine
1.26 * sets the global variable "sc_intest" to true, it is restored upon termination.
1.27 - * In the case the assignment was intended, use parantheses around the
1.28 + * In the case the assignment was intended, use parentheses around the
1.29 * expression to avoid the warning; primary() sets "sc_intest" to 0.
1.30 *
1.31 * Global references: sc_intest (altered, but restored upon termination)