Ignore:
Timestamp:
Jun 23, 2012, 11:13:45 AM (7 years ago)
Author:
sam
Message:

build: fix the PS3 port by using our trig.h everywhere instead of stdlib
functions; also remove a lot of idiotic "using namespace std" from the
codebase.

Location:
trunk/src/easymesh
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/easymesh/easymesh-scanner.l

    r1510 r1512  
    1515#   include "config.h"
    1616#endif
     17
     18#include <cstdlib>
     19using std::exit;
     20using std::malloc;
     21using std::realloc;
     22using std::free;
    1723
    1824#include "core.h"
     
    7884
    7985#[0-9a-f]{3} {
    80         uint32_t tmp = strtol(yytext + 1, NULL, 16);
     86        uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
    8187        yylval->u32val = 0x11000000u * (tmp >> 8)
    8288                       | 0x00110000u * ((tmp >> 4) & 0xf)
     
    8591        return token::COLOR; }
    8692#[0-9a-f]{4} {
    87         uint32_t tmp = strtol(yytext + 1, NULL, 16);
     93        uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
    8894        yylval->u32val = 0x11000000u * (tmp >> 12)
    8995                       | 0x00110000u * ((tmp >> 8) & 0xf)
     
    9399#[0-9a-f]{6} {
    94100        yylval->u32val = 0xffu
    95                        | 0x100u * (uint32_t)strtol(yytext + 1, NULL, 16);
     101                       | 0x100u * (uint32_t)std::strtol(yytext + 1, NULL, 16);
    96102        return token::COLOR; }
    97103#[0-9a-f]{8} {
    98         yylval->u32val = (uint32_t)strtol(yytext + 1, NULL, 16);
     104        yylval->u32val = (uint32_t)std::strtol(yytext + 1, NULL, 16);
    99105        return token::COLOR; }
    100106[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)? {
    101         yylval->fval = atof(yytext); return token::NUMBER; }
     107        yylval->fval = std::atof(yytext); return token::NUMBER; }
    102108-     { return token_type('-'); }
    103109"["   { return token_type('['); }
  • trunk/src/easymesh/easymesh.cpp

    r1510 r1512  
    353353
    354354    vec3 d = size * 0.5f;
    355     float const pi = std::acos(-1.0f);
     355    float const pi = acos(-1.0f);
    356356
    357357    Array<vec2> table;
    358358    for (int i = 0; i <= ndivisions; i++)
    359         table.Push(vec2(std::sin(pi * 2 / ndivisions * i) + 1e-5f,
    360                         std::cos(pi * 2 / ndivisions * i) + 1e-5f));
     359        table.Push(vec2(sin(pi * 2 / ndivisions * i) + 1e-5f,
     360                        cos(pi * 2 / ndivisions * i) + 1e-5f));
    361361
    362362    for (int j = 0; j <= ndivisions / 2; j++)
Note: See TracChangeset for help on using the changeset viewer.