Skip to content

Commit da900aa

Browse files
author
Alex Cole
committed
Use __ prefixes in the few local variables, just to avoid more conflicts.
1 parent 68d745b commit da900aa

5 files changed

Lines changed: 202 additions & 100 deletions

File tree

console.inc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,18 @@
3838
* <seealso name="printf"/>
3939
* <return>This function always returns 0.</return>
4040
*/
41-
stock print(const string[], foreground = -1, background = -1)
41+
/*
42+
native print(const string[], foreground = -1, background = -1);
43+
*/
44+
stock print(const __string[], __foreground = -1, __background = -1)
4245
{
4346
// Quote:
4447
//
4548
// > Note that a [...] host application may not support colours
4649
//
4750
// So we can just ignore them.
48-
#pragma unused foreground, background
49-
return __print(string);
51+
#pragma unused __foreground, __background
52+
return __print(__string);
5053
}
5154

5255
/**

file.inc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,11 +231,14 @@ native flength(File:handle);
231231
* <param name="handle">The file handle returned by <a href="#fopen">fopen</a> or <a href="#ftemp">ftemp</a></param>
232232
* <remarks>Actually just calls <c>flength</c> as that has to force a flush to be accurate.</remarks>
233233
*/
234-
stock bool:fflush(File:handle)
234+
/*
235+
native bool:fflush(File:handle);
236+
*/
237+
stock bool:fflush(File:__handle)
235238
{
236-
if (handle)
239+
if (__handle)
237240
{
238-
flength(handle);
241+
flength(__handle);
239242
return true;
240243
}
241244
return false;

float.inc

Lines changed: 130 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -322,209 +322,287 @@ native Float:operator=(oper) = float;
322322
/**
323323
* <library>float</library>
324324
*/
325-
stock Float:operator++(Float:oper)
325+
/*
326+
native Float:operator++(Float:oper);
327+
*/
328+
stock Float:operator++(Float:__oper)
326329
{
327-
return oper + 1.0;
330+
return __oper + 1.0;
328331
}
329332

330333
/**
331334
* <library>float</library>
332335
*/
333-
stock Float:operator--(Float:oper)
336+
/*
337+
native Float:operator--(Float:oper);
338+
*/
339+
stock Float:operator--(Float:__oper)
334340
{
335-
return oper - 1.0;
341+
return __oper - 1.0;
336342
}
337343

338344
/**
339345
* <library>float</library>
340346
*/
341-
stock Float:operator-(Float:oper)
347+
/*
348+
native Float:operator-(Float:oper);
349+
*/
350+
stock Float:operator-(Float:__oper)
342351
{
343-
return oper ^ Float:cellmin; /* IEEE values are sign/magnitude */
352+
return __oper ^ Float:cellmin; /* IEEE values are sign/magnitude */
344353
}
345354

346355
/**
347356
* <library>float</library>
348357
*/
349-
stock Float:operator*(Float:oper1, oper2)
358+
/*
359+
native Float:operator*(Float:oper1, oper2);
360+
*/
361+
stock Float:operator*(Float:__oper1, __oper2)
350362
{
351-
return floatmul(oper1, float(oper2)); /* "*" is commutative */
363+
return floatmul(__oper1, float(__oper2)); /* "*" is commutative */
352364
}
353365

354366
/**
355367
* <library>float</library>
356368
*/
357-
stock Float:operator/(Float:oper1, oper2)
369+
/*
370+
native Float:operator/(Float:oper1, oper2);
371+
*/
372+
stock Float:operator/(Float:__oper1, __oper2)
358373
{
359-
return floatdiv(oper1, float(oper2));
374+
return floatdiv(__oper1, float(__oper2));
360375
}
361376

362377
/**
363378
* <library>float</library>
364379
*/
365-
stock Float:operator/(oper1, Float:oper2)
380+
/*
381+
native Float:operator/(oper1, Float:oper2);
382+
*/
383+
stock Float:operator/(__oper1, Float:__oper2)
366384
{
367-
return floatdiv(float(oper1), oper2);
385+
return floatdiv(float(__oper1), __oper2);
368386
}
369387

370388
/**
371389
* <library>float</library>
372390
*/
373-
stock Float:operator+(Float:oper1, oper2)
391+
/*
392+
native Float:operator+(Float:oper1, oper2);
393+
*/
394+
stock Float:operator+(Float:__oper1, __oper2)
374395
{
375-
return floatadd(oper1, float(oper2)); /* "+" is commutative */
396+
return floatadd(__oper1, float(__oper2)); /* "+" is commutative */
376397
}
377398

378399
/**
379400
* <library>float</library>
380401
*/
381-
stock Float:operator-(Float:oper1, oper2)
402+
/*
403+
native Float:operator-(Float:oper1, oper2);
404+
*/
405+
stock Float:operator-(Float:__oper1, __oper2)
382406
{
383-
return floatsub(oper1, float(oper2));
407+
return floatsub(__oper1, float(__oper2));
384408
}
385409

386410
/**
387411
* <library>float</library>
388412
*/
389-
stock Float:operator-(oper1, Float:oper2)
413+
/*
414+
native Float:operator-(oper1, Float:oper2);
415+
*/
416+
stock Float:operator-(__oper1, Float:__oper2)
390417
{
391-
return floatsub(float(oper1), oper2);
418+
return floatsub(float(__oper1), __oper2);
392419
}
393420

394421
/**
395422
* <library>float</library>
396423
*/
397-
stock bool:operator==(Float:oper1, Float:oper2)
424+
/*
425+
native bool:operator==(Float:oper1, Float:oper2);
426+
*/
427+
stock bool:operator==(Float:__oper1, Float:__oper2)
398428
{
399-
return floatcmp(oper1, oper2) == 0;
429+
return floatcmp(__oper1, __oper2) == 0;
400430
}
401431

402432
/**
403433
* <library>float</library>
404434
*/
405-
stock bool:operator==(Float:oper1, oper2)
435+
/*
436+
native bool:operator==(Float:oper1, oper2);
437+
*/
438+
stock bool:operator==(Float:__oper1, __oper2)
406439
{
407-
return floatcmp(oper1, float(oper2)) == 0; /* "==" is commutative */
440+
return floatcmp(__oper1, float(__oper2)) == 0; /* "==" is commutative */
408441
}
409442

410443
/**
411444
* <library>float</library>
412445
*/
413-
stock bool:operator!=(Float:oper1, Float:oper2)
446+
/*
447+
native bool:operator!=(Float:oper1, Float:oper2);
448+
*/
449+
stock bool:operator!=(Float:__oper1, Float:__oper2)
414450
{
415-
return floatcmp(oper1, oper2) != 0;
451+
return floatcmp(__oper1, __oper2) != 0;
416452
}
417453

418454
/**
419455
* <library>float</library>
420456
*/
421-
stock bool:operator!=(Float:oper1, oper2)
457+
/*
458+
native bool:operator!=(Float:oper1, Float:oper2);
459+
*/
460+
stock bool:operator!=(Float:__oper1, __oper2)
422461
{
423-
return floatcmp(oper1, float(oper2)) != 0; /* "!=" is commutative */
462+
return floatcmp(__oper1, float(__oper2)) != 0; /* "!=" is commutative */
424463
}
425464

426465
/**
427466
* <library>float</library>
428467
*/
429-
stock bool:operator>(Float:oper1, Float:oper2)
468+
/*
469+
native bool:operator>(Float:oper1, Float:oper2);
470+
*/
471+
stock bool:operator>(Float:__oper1, Float:__oper2)
430472
{
431-
return floatcmp(oper1, oper2) > 0;
473+
return floatcmp(__oper1, __oper2) > 0;
432474
}
433475

434476
/**
435477
* <library>float</library>
436478
*/
437-
stock bool:operator>(Float:oper1, oper2)
479+
/*
480+
native bool:operator>(Float:oper1, oper2);
481+
*/
482+
stock bool:operator>(Float:__oper1, __oper2)
438483
{
439-
return floatcmp(oper1, float(oper2)) > 0;
484+
return floatcmp(__oper1, float(__oper2)) > 0;
440485
}
441486

442487
/**
443488
* <library>float</library>
444489
*/
445-
stock bool:operator>(oper1, Float:oper2)
490+
/*
491+
native bool:operator>(oper1, Float:oper2);
492+
*/
493+
stock bool:operator>(__oper1, Float:__oper2)
446494
{
447-
return floatcmp(float(oper1), oper2) > 0;
495+
return floatcmp(float(__oper1), __oper2) > 0;
448496
}
449497

450498
/**
451499
* <library>float</library>
452500
*/
453-
stock bool:operator>=(Float:oper1, Float:oper2)
501+
/*
502+
native bool:operator>=(Float:oper1, Float:oper2);
503+
*/
504+
stock bool:operator>=(Float:__oper1, Float:__oper2)
454505
{
455-
return floatcmp(oper1, oper2) >= 0;
506+
return floatcmp(__oper1, __oper2) >= 0;
456507
}
457508

458509
/**
459510
* <library>float</library>
460511
*/
461-
stock bool:operator>=(Float:oper1, oper2)
512+
/*
513+
native bool:operator>=(Float:oper1, oper2);
514+
*/
515+
stock bool:operator>=(Float:__oper1, __oper2)
462516
{
463-
return floatcmp(oper1, float(oper2)) >= 0;
517+
return floatcmp(__oper1, float(__oper2)) >= 0;
464518
}
465519

466520
/**
467521
* <library>float</library>
468522
*/
469-
stock bool:operator>=(oper1, Float:oper2)
523+
/*
524+
native bool:operator>=(oper1, Float:oper2);
525+
*/
526+
stock bool:operator>=(__oper1, Float:__oper2)
470527
{
471-
return floatcmp(float(oper1), oper2) >= 0;
528+
return floatcmp(float(__oper1), __oper2) >= 0;
472529
}
473530

474531
/**
475532
* <library>float</library>
476533
*/
477-
stock bool:operator<(Float:oper1, Float:oper2)
534+
/*
535+
native bool:operator<(Float:oper1, Float:oper2);
536+
*/
537+
stock bool:operator<(Float:__oper1, Float:__oper2)
478538
{
479-
return floatcmp(oper1, oper2) < 0;
539+
return floatcmp(__oper1, __oper2) < 0;
480540
}
481541

482542
/**
483543
* <library>float</library>
484544
*/
485-
stock bool:operator<(Float:oper1, oper2)
545+
/*
546+
native bool:operator<(Float:oper1, oper2);
547+
*/
548+
stock bool:operator<(Float:__oper1, __oper2)
486549
{
487-
return floatcmp(oper1, float(oper2)) < 0;
550+
return floatcmp(__oper1, float(__oper2)) < 0;
488551
}
489552

490553
/**
491554
* <library>float</library>
492555
*/
493-
stock bool:operator<(oper1, Float:oper2)
556+
/*
557+
native bool:operator<(oper1, Float:oper2);
558+
*/
559+
stock bool:operator<(__oper1, Float:__oper2)
494560
{
495-
return floatcmp(float(oper1), oper2) < 0;
561+
return floatcmp(float(__oper1), __oper2) < 0;
496562
}
497563

498564
/**
499565
* <library>float</library>
500566
*/
501-
stock bool:operator<=(Float:oper1, Float:oper2)
567+
/*
568+
native bool:operator<=(Float:oper1, Float:oper2);
569+
*/
570+
stock bool:operator<=(Float:__oper1, Float:__oper2)
502571
{
503-
return floatcmp(oper1, oper2) <= 0;
572+
return floatcmp(__oper1, __oper2) <= 0;
504573
}
505574

506575
/**
507576
* <library>float</library>
508577
*/
509-
stock bool:operator<=(Float:oper1, oper2)
578+
/*
579+
native bool:operator<=(Float:oper1, oper2);
580+
*/
581+
stock bool:operator<=(Float:__oper1, __oper2)
510582
{
511-
return floatcmp(oper1, float(oper2)) <= 0;
583+
return floatcmp(__oper1, float(__oper2)) <= 0;
512584
}
513585

514586
/**
515587
* <library>float</library>
516588
*/
517-
stock bool:operator<=(oper1, Float:oper2)
589+
/*
590+
native bool:operator<=(oper1, Float:oper2);
591+
*/
592+
stock bool:operator<=(__oper1, Float:__oper2)
518593
{
519-
return floatcmp(float(oper1), oper2) <= 0;
594+
return floatcmp(float(__oper1), __oper2) <= 0;
520595
}
521596

522597
/**
523598
* <library>float</library>
524599
*/
525-
stock bool:operator!(Float:oper)
600+
/*
601+
native bool:operator!(Float:oper);
602+
*/
603+
stock bool:operator!(Float:__oper)
526604
{
527-
return (_:oper & cellmax) == 0;
605+
return (_:__oper & cellmax) == 0;
528606
}
529607

530608
/* forbidden operations */

0 commit comments

Comments
 (0)