Changeset 2506


Ignore:
Timestamp:
Feb 26, 2013, 2:43:45 PM (7 years ago)
Author:
sam
Message:

base: start removing occurrences of NULL on our long journey to nullptr.

Location:
trunk
Files:
50 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/base/string.cpp

    r2256 r2506  
    6060    /* vsnprintf() tells us how many character we need, and we need to
    6161     * add one for the terminating null byte. */
    62     size_t needed = vsnprintf(NULL, 0, format, ap2) + 1;
     62    size_t needed = vsnprintf(nullptr, 0, format, ap2) + 1;
    6363
    6464    ((Super &)ret).Reserve(needed);
  • trunk/src/core.h

    r2500 r2506  
    4545#   define FP_USE(x) (void)(x)
    4646#endif
     47
     48
     49/* Ensure we have nullptr */
     50#if defined nullptr
     51    /* do nothing */
     52#elif defined __GNUC__
     53#   define nullptr __null
     54#else
     55#   include <cstddef>
     56#   define nullptr NULL
     57#endif
     58
    4759
    4860/* Ensure isnan() is present even on systems that don't define it, or
  • trunk/src/debug/fps.cpp

    r2403 r2506  
    4545    for (int i = 0; i < 5; i ++)
    4646    {
    47         data->lines[i] = new Text(NULL, "data/font/ascii.png");
     47        data->lines[i] = new Text(nullptr, "data/font/ascii.png");
    4848        data->lines[i]->SetPos(ivec3(x, y + (i ? 8 : 0) + 16 * i, 0));
    4949        Ticker::Ref(data->lines[i]);
    5050    }
    5151#else
    52     data->lines[0] = new Text(NULL, "data/font/ascii.png");
     52    data->lines[0] = new Text(nullptr, "data/font/ascii.png");
    5353    data->lines[0]->SetPos(ivec3(x, y, 100));
    5454    Ticker::Ref(data->lines[0]);
  • trunk/src/debug/record.cpp

    r2216 r2506  
    5757    data->fps = (int)(fps + 0.5f);
    5858#if defined USE_PIPI
    59     data->sequence = NULL;
     59    data->sequence = nullptr;
    6060#endif
    6161
  • trunk/src/dict.cpp

    r2216 r2506  
    107107        {
    108108            empty = data->m_entities.Count();
    109             data->m_entities.Push(NULL);
     109            data->m_entities.Push(nullptr);
    110110        }
    111111
    112         data->m_entities[empty] = NULL;
     112        data->m_entities[empty] = nullptr;
    113113        slotid = empty;
    114114        data->nentities++;
     
    126126    if (Ticker::Unref(data->m_entities[slotid]) == 0)
    127127    {
    128         data->m_entities[slotid] = NULL;
     128        data->m_entities[slotid] = nullptr;
    129129        data->nentities--;
    130130    }
  • trunk/src/easymesh/easymesh-scanner.l

    r2410 r2506  
    111111
    112112#[0-9a-fA-F]{3} {
    113         uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
     113        uint32_t tmp = std::strtol(yytext + 1, nullptr, 16);
    114114        yylval->u32val = 0x11000000u * (tmp >> 8)
    115115                       | 0x00110000u * ((tmp >> 4) & 0xf)
     
    118118        return token::COLOR; }
    119119#[0-9a-fA-F]{4} {
    120         uint32_t tmp = std::strtol(yytext + 1, NULL, 16);
     120        uint32_t tmp = std::strtol(yytext + 1, nullptr, 16);
    121121        yylval->u32val = 0x11000000u * (tmp >> 12)
    122122                       | 0x00110000u * ((tmp >> 8) & 0xf)
     
    126126#[0-9a-fA-F]{6} {
    127127        yylval->u32val = 0xffu
    128                        | 0x100u * (uint32_t)std::strtol(yytext + 1, NULL, 16);
     128                       | 0x100u * (uint32_t)std::strtol(yytext + 1, nullptr, 16);
    129129        return token::COLOR; }
    130130#[0-9a-fA-F]{8} {
    131         yylval->u32val = (uint32_t)std::strtol(yytext + 1, NULL, 16);
     131        yylval->u32val = (uint32_t)std::strtol(yytext + 1, nullptr, 16);
    132132        return token::COLOR; }
    133133[-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)? {
  • trunk/src/easymesh/easymesh.cpp

    r2480 r2506  
    8686        if (m_shader_uniform[i].m1 == uniform)
    8787            return &m_shader_uniform[i].m2;
    88     return NULL;
     88    return nullptr;
    8989}
    9090
     
    9595        if (m_shader_attrib[i].m1 == attribute)
    9696            return &m_shader_attrib[i].m2;
    97     return NULL;
     97    return nullptr;
    9898}
    9999
     
    182182    m_vertexcount = 0;
    183183    m_indexcount = 0;
    184     m_ibo = NULL;
     184    m_ibo = nullptr;
    185185}
    186186
     
    221221        m_gpudatas.Reserve(DebugRenderMode::Max);
    222222        for (int i = 0; i < DebugRenderMode::Max; i++)
    223             m_gpudatas << NULL;
     223            m_gpudatas << nullptr;
    224224    }
    225225    m_gpudatas[gpudata->m_render_mode] = gpudata;
     
    233233            return;
    234234
    235     VertexDeclaration* new_vdecl = NULL;
    236     VertexBuffer* new_vbo = NULL;
    237     void *vbo_data = NULL;
     235    VertexDeclaration* new_vdecl = nullptr;
     236    VertexBuffer* new_vbo = nullptr;
     237    void *vbo_data = nullptr;
    238238    int vbo_bytes = 0;
    239239
     
    365365//-----------------------------------------------------------------------------
    366366EasyMesh::EasyMesh()
    367   : m_build_data(NULL)
     367  : m_build_data(nullptr)
    368368{
    369369    m_cursors.Push(0, 0);
     
    392392{
    393393    delete(m_build_data);
    394     m_build_data = NULL;
     394    m_build_data = nullptr;
    395395
    396396    if (new_gpu_sdata)
     
    22512251
    22522252//-----------------------------------------------------------------------------
    2253 void EasyMesh::SplitTriangles(int pass) { SplitTriangles(pass, NULL); }
     2253void EasyMesh::SplitTriangles(int pass) { SplitTriangles(pass, nullptr); }
    22542254
    22552255//-----------------------------------------------------------------------------
  • trunk/src/easymesh/easymesh.h

    r2480 r2506  
    488488    int FindVertexMaster(const int search_idx);
    489489    bool FindMatchingVertices(const int search_idx, Array<int> &matching_ids);
    490     bool FindConnectedVertices(const int search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_vert, Array<int> const *ignored_tri = NULL);
    491     bool FindConnectedTriangles(const int search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_tri, Array<int> const *ignored_tri = NULL);
    492     bool FindConnectedTriangles(const ivec2 &search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_tri, Array<int> const *ignored_tri = NULL);
    493     bool FindConnectedTriangles(const ivec3 &search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_tri, Array<int> const *ignored_tri = NULL);
     490    bool FindConnectedVertices(const int search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_vert, Array<int> const *ignored_tri = nullptr);
     491    bool FindConnectedTriangles(const int search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_tri, Array<int> const *ignored_tri = nullptr);
     492    bool FindConnectedTriangles(const ivec2 &search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_tri, Array<int> const *ignored_tri = nullptr);
     493    bool FindConnectedTriangles(const ivec3 &search_idx, const Array<uint16_t> &tri_list, const int tri0, Array<int> &connected_tri, Array<int> const *ignored_tri = nullptr);
    494494    void AddVertex(int vert_id, vec3 vert_coord);
    495495    bool GetMasterList(Array<int> &ret_master_list) { ret_master_list = master_list; return ret_master_list.Count() > 0; }
     
    525525    bool Compile(char const *command);
    526526    void MeshConvert(GpuShaderData* new_gpu_sdata);
    527     void MeshConvert(Shader* ProvidedShader = NULL);
     527    void MeshConvert(Shader* ProvidedShader = nullptr);
    528528    void Render(mat4 const &model);
    529529
  • trunk/src/eglapp.cpp

    r2301 r2506  
    7979    data->egl_dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY);
    8080#   else
    81     data->dpy = XOpenDisplay(NULL);
    82     if (data->dpy == NULL)
     81    data->dpy = XOpenDisplay(nullptr);
     82    if (data->dpy == nullptr)
    8383    {
    8484        Log::Error("cannot connect to X server\n");
     
    116116    }
    117117
    118     if (!eglInitialize(data->egl_dpy, NULL, NULL))
     118    if (!eglInitialize(data->egl_dpy, nullptr, nullptr))
    119119    {
    120120        Log::Error("cannot initialize EGL\n");
     
    188188
    189189    data->egl_surf = eglCreateWindowSurface(data->egl_dpy, ecfg,
    190                                             &data->nativewindow, NULL);
     190                                            &data->nativewindow, nullptr);
    191191#   else
    192192    data->egl_surf = eglCreateWindowSurface(data->egl_dpy, ecfg,
    193193                                            (EGLNativeWindowType)data->win,
    194                                             NULL);
     194                                            nullptr);
    195195#   endif
    196196    if (data->egl_surf == EGL_NO_SURFACE)
  • trunk/src/generated/easymesh-parser.cpp

    r2410 r2506  
    1 /* A Bison parser, made by GNU Bison 2.4.2.  */
     1/* A Bison parser, made by GNU Bison 2.5.  */
    22
    33/* Skeleton implementation for Bison LALR(1) parsers in C++
    44   
    5       Copyright (C) 2002-2010 Free Software Foundation, Inc.
     5      Copyright (C) 2002-2011 Free Software Foundation, Inc.
    66   
    77   This program is free software: you can redistribute it and/or modify
     
    3636/* First part of user declarations.  */
    3737
    38 /* Line 310 of lalr1.cc  */
     38/* Line 293 of lalr1.cc  */
    3939#line 1 "easymesh/easymesh-parser.y"
    4040
     
    6262
    6363
    64 /* Line 310 of lalr1.cc  */
     64/* Line 293 of lalr1.cc  */
    6565#line 66 "generated/easymesh-parser.cpp"
    6666
     
    7070/* User implementation prologue.  */
    7171
    72 /* Line 316 of lalr1.cc  */
     72/* Line 299 of lalr1.cc  */
    7373#line 66 "easymesh/easymesh-parser.y"
    7474
     
    7979
    8080
    81 /* Line 316 of lalr1.cc  */
     81/* Line 299 of lalr1.cc  */
    8282#line 83 "generated/easymesh-parser.cpp"
    8383
     
    9494#endif
    9595
     96/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
     97   If N is 0, then set CURRENT to the empty location which ends
     98   the previous symbol: RHS[0] (always defined).  */
     99
     100#define YYRHSLOC(Rhs, K) ((Rhs)[K])
     101#ifndef YYLLOC_DEFAULT
     102# define YYLLOC_DEFAULT(Current, Rhs, N)                               \
     103 do                                                                    \
     104   if (N)                                                              \
     105     {                                                                 \
     106       (Current).begin = YYRHSLOC (Rhs, 1).begin;                      \
     107       (Current).end   = YYRHSLOC (Rhs, N).end;                        \
     108     }                                                                 \
     109   else                                                                \
     110     {                                                                 \
     111       (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end;        \
     112     }                                                                 \
     113 while (false)
     114#endif
     115
    96116/* Suppress unused-variable warnings by "using" E.  */
    97117#define YYUSE(e) ((void) (e))
     
    145165namespace lol {
    146166
    147 /* Line 379 of lalr1.cc  */
    148 #line 149 "generated/easymesh-parser.cpp"
    149 #if YYERROR_VERBOSE
     167/* Line 382 of lalr1.cc  */
     168#line 169 "generated/easymesh-parser.cpp"
    150169
    151170  /* Return YYSTR after stripping away unnecessary quotes and
     
    186205  }
    187206
    188 #endif
    189207
    190208  /// Build a parser object.
     
    287305#endif
    288306
     307  inline bool
     308  EasyMeshParser::yy_pact_value_is_default_ (int yyvalue)
     309  {
     310    return yyvalue == yypact_ninf_;
     311  }
     312
     313  inline bool
     314  EasyMeshParser::yy_table_value_is_error_ (int yyvalue)
     315  {
     316    return yyvalue == yytable_ninf_;
     317  }
     318
    289319  int
    290320  EasyMeshParser::parse ()
     
    308338    location_type yylloc;
    309339    /// The locations where the error started and ended.
    310     location_type yyerror_range[2];
     340    location_type yyerror_range[3];
    311341
    312342    /// $$.
     
    346376    /* Try to take a decision without lookahead.  */
    347377    yyn = yypact_[yystate];
    348     if (yyn == yypact_ninf_)
     378    if (yy_pact_value_is_default_ (yyn))
    349379      goto yydefault;
    350380
     
    379409    if (yyn <= 0)
    380410      {
    381         if (yyn == 0 || yyn == yytable_ninf_)
    382         goto yyerrlab;
     411        if (yy_table_value_is_error_ (yyn))
     412          goto yyerrlab;
    383413        yyn = -yyn;
    384414        goto yyreduce;
     
    436466          case 7:
    437467
    438 /* Line 677 of lalr1.cc  */
     468/* Line 690 of lalr1.cc  */
    439469#line 90 "easymesh/easymesh-parser.y"
    440470    { mc.m_mesh.OpenBrace(); }
     
    443473  case 8:
    444474
    445 /* Line 677 of lalr1.cc  */
     475/* Line 690 of lalr1.cc  */
    446476#line 94 "easymesh/easymesh-parser.y"
    447477    { mc.m_mesh.CloseBrace(); }
     
    450480  case 14:
    451481
    452 /* Line 677 of lalr1.cc  */
     482/* Line 690 of lalr1.cc  */
    453483#line 109 "easymesh/easymesh-parser.y"
    454484    { mc.m_mesh.SetCurColor(vec4((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); }
     
    457487  case 15:
    458488
    459 /* Line 677 of lalr1.cc  */
     489/* Line 690 of lalr1.cc  */
    460490#line 110 "easymesh/easymesh-parser.y"
    461491    { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val);
     
    466496  case 16:
    467497
    468 /* Line 677 of lalr1.cc  */
     498/* Line 690 of lalr1.cc  */
    469499#line 113 "easymesh/easymesh-parser.y"
    470500    { mc.m_mesh.SetCurColor2(vec4((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3)); }
     
    473503  case 17:
    474504
    475 /* Line 677 of lalr1.cc  */
     505/* Line 690 of lalr1.cc  */
    476506#line 114 "easymesh/easymesh-parser.y"
    477507    { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val);
     
    482512  case 18:
    483513
    484 /* Line 677 of lalr1.cc  */
     514/* Line 690 of lalr1.cc  */
    485515#line 120 "easymesh/easymesh-parser.y"
    486516    { mc.m_mesh.Chamfer((yysemantic_stack_[(2) - (2)].args).f0); }
     
    489519  case 19:
    490520
    491 /* Line 677 of lalr1.cc  */
     521/* Line 690 of lalr1.cc  */
    492522#line 121 "easymesh/easymesh-parser.y"
    493523    { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); }
     
    496526  case 20:
    497527
    498 /* Line 677 of lalr1.cc  */
     528/* Line 690 of lalr1.cc  */
    499529#line 122 "easymesh/easymesh-parser.y"
    500530    { mc.m_mesh.Translate(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); }
     
    503533  case 21:
    504534
    505 /* Line 677 of lalr1.cc  */
     535/* Line 690 of lalr1.cc  */
    506536#line 123 "easymesh/easymesh-parser.y"
    507537    { mc.m_mesh.Translate(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); }
     
    510540  case 22:
    511541
    512 /* Line 677 of lalr1.cc  */
     542/* Line 690 of lalr1.cc  */
    513543#line 124 "easymesh/easymesh-parser.y"
    514544    { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
     
    517547  case 23:
    518548
    519 /* Line 677 of lalr1.cc  */
     549/* Line 690 of lalr1.cc  */
    520550#line 125 "easymesh/easymesh-parser.y"
    521551    { mc.m_mesh.RotateX((yysemantic_stack_[(2) - (2)].args).f0); }
     
    524554  case 24:
    525555
    526 /* Line 677 of lalr1.cc  */
     556/* Line 690 of lalr1.cc  */
    527557#line 126 "easymesh/easymesh-parser.y"
    528558    { mc.m_mesh.RotateY((yysemantic_stack_[(2) - (2)].args).f0); }
     
    531561  case 25:
    532562
    533 /* Line 677 of lalr1.cc  */
     563/* Line 690 of lalr1.cc  */
    534564#line 127 "easymesh/easymesh-parser.y"
    535565    { mc.m_mesh.RotateZ((yysemantic_stack_[(2) - (2)].args).f0); }
     
    538568  case 26:
    539569
    540 /* Line 677 of lalr1.cc  */
     570/* Line 690 of lalr1.cc  */
    541571#line 128 "easymesh/easymesh-parser.y"
    542572    { mc.m_mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     
    545575  case 27:
    546576
    547 /* Line 677 of lalr1.cc  */
     577/* Line 690 of lalr1.cc  */
    548578#line 129 "easymesh/easymesh-parser.y"
    549579    { mc.m_mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
     
    552582  case 28:
    553583
    554 /* Line 677 of lalr1.cc  */
     584/* Line 690 of lalr1.cc  */
    555585#line 130 "easymesh/easymesh-parser.y"
    556586    { mc.m_mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     
    559589  case 29:
    560590
    561 /* Line 677 of lalr1.cc  */
     591/* Line 690 of lalr1.cc  */
    562592#line 131 "easymesh/easymesh-parser.y"
    563593    { mc.m_mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
     
    566596  case 30:
    567597
    568 /* Line 677 of lalr1.cc  */
     598/* Line 690 of lalr1.cc  */
    569599#line 132 "easymesh/easymesh-parser.y"
    570600    { mc.m_mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     
    573603  case 31:
    574604
    575 /* Line 677 of lalr1.cc  */
     605/* Line 690 of lalr1.cc  */
    576606#line 133 "easymesh/easymesh-parser.y"
    577607    { mc.m_mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
     
    580610  case 32:
    581611
    582 /* Line 677 of lalr1.cc  */
     612/* Line 690 of lalr1.cc  */
    583613#line 134 "easymesh/easymesh-parser.y"
    584614    { mc.m_mesh.TwistX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
     
    587617  case 33:
    588618
    589 /* Line 677 of lalr1.cc  */
     619/* Line 690 of lalr1.cc  */
    590620#line 135 "easymesh/easymesh-parser.y"
    591621    { mc.m_mesh.TwistY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
     
    594624  case 34:
    595625
    596 /* Line 677 of lalr1.cc  */
     626/* Line 690 of lalr1.cc  */
    597627#line 136 "easymesh/easymesh-parser.y"
    598628    { mc.m_mesh.TwistZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
     
    601631  case 35:
    602632
    603 /* Line 677 of lalr1.cc  */
     633/* Line 690 of lalr1.cc  */
    604634#line 137 "easymesh/easymesh-parser.y"
    605635    { mc.m_mesh.ShearX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     
    608638  case 36:
    609639
    610 /* Line 677 of lalr1.cc  */
     640/* Line 690 of lalr1.cc  */
    611641#line 138 "easymesh/easymesh-parser.y"
    612642    { mc.m_mesh.ShearX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
     
    615645  case 37:
    616646
    617 /* Line 677 of lalr1.cc  */
     647/* Line 690 of lalr1.cc  */
    618648#line 139 "easymesh/easymesh-parser.y"
    619649    { mc.m_mesh.ShearY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     
    622652  case 38:
    623653
    624 /* Line 677 of lalr1.cc  */
     654/* Line 690 of lalr1.cc  */
    625655#line 140 "easymesh/easymesh-parser.y"
    626656    { mc.m_mesh.ShearY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
     
    629659  case 39:
    630660
    631 /* Line 677 of lalr1.cc  */
     661/* Line 690 of lalr1.cc  */
    632662#line 141 "easymesh/easymesh-parser.y"
    633663    { mc.m_mesh.ShearZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     
    636666  case 40:
    637667
    638 /* Line 677 of lalr1.cc  */
     668/* Line 690 of lalr1.cc  */
    639669#line 142 "easymesh/easymesh-parser.y"
    640670    { mc.m_mesh.ShearZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, (yysemantic_stack_[(2) - (2)].args).f3); }
     
    643673  case 41:
    644674
    645 /* Line 677 of lalr1.cc  */
     675/* Line 690 of lalr1.cc  */
    646676#line 143 "easymesh/easymesh-parser.y"
    647677    { mc.m_mesh.StretchX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     
    650680  case 42:
    651681
    652 /* Line 677 of lalr1.cc  */
     682/* Line 690 of lalr1.cc  */
    653683#line 144 "easymesh/easymesh-parser.y"
    654684    { mc.m_mesh.StretchY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     
    657687  case 43:
    658688
    659 /* Line 677 of lalr1.cc  */
     689/* Line 690 of lalr1.cc  */
    660690#line 145 "easymesh/easymesh-parser.y"
    661691    { mc.m_mesh.StretchZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     
    664694  case 44:
    665695
    666 /* Line 677 of lalr1.cc  */
     696/* Line 690 of lalr1.cc  */
    667697#line 146 "easymesh/easymesh-parser.y"
    668698    { mc.m_mesh.BendXY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
     
    671701  case 45:
    672702
    673 /* Line 677 of lalr1.cc  */
     703/* Line 690 of lalr1.cc  */
    674704#line 147 "easymesh/easymesh-parser.y"
    675705    { mc.m_mesh.BendXZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
     
    678708  case 46:
    679709
    680 /* Line 677 of lalr1.cc  */
     710/* Line 690 of lalr1.cc  */
    681711#line 148 "easymesh/easymesh-parser.y"
    682712    { mc.m_mesh.BendYX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
     
    685715  case 47:
    686716
    687 /* Line 677 of lalr1.cc  */
     717/* Line 690 of lalr1.cc  */
    688718#line 149 "easymesh/easymesh-parser.y"
    689719    { mc.m_mesh.BendYZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
     
    692722  case 48:
    693723
    694 /* Line 677 of lalr1.cc  */
     724/* Line 690 of lalr1.cc  */
    695725#line 150 "easymesh/easymesh-parser.y"
    696726    { mc.m_mesh.BendZX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
     
    699729  case 49:
    700730
    701 /* Line 677 of lalr1.cc  */
     731/* Line 690 of lalr1.cc  */
    702732#line 151 "easymesh/easymesh-parser.y"
    703733    { mc.m_mesh.BendZY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
     
    706736  case 50:
    707737
    708 /* Line 677 of lalr1.cc  */
     738/* Line 690 of lalr1.cc  */
    709739#line 152 "easymesh/easymesh-parser.y"
    710740    { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, 1.0, 1.0)); }
     
    713743  case 51:
    714744
    715 /* Line 677 of lalr1.cc  */
     745/* Line 690 of lalr1.cc  */
    716746#line 153 "easymesh/easymesh-parser.y"
    717747    { mc.m_mesh.Scale(vec3(1.0, (yysemantic_stack_[(2) - (2)].args).f0, 1.0)); }
     
    720750  case 52:
    721751
    722 /* Line 677 of lalr1.cc  */
     752/* Line 690 of lalr1.cc  */
    723753#line 154 "easymesh/easymesh-parser.y"
    724754    { mc.m_mesh.Scale(vec3(1.0, 1.0, (yysemantic_stack_[(2) - (2)].args).f0)); }
     
    727757  case 53:
    728758
    729 /* Line 677 of lalr1.cc  */
     759/* Line 690 of lalr1.cc  */
    730760#line 155 "easymesh/easymesh-parser.y"
    731761    { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
     
    734764  case 54:
    735765
    736 /* Line 677 of lalr1.cc  */
     766/* Line 690 of lalr1.cc  */
    737767#line 156 "easymesh/easymesh-parser.y"
    738768    { mc.m_mesh.MirrorX(); }
     
    741771  case 55:
    742772
    743 /* Line 677 of lalr1.cc  */
     773/* Line 690 of lalr1.cc  */
    744774#line 157 "easymesh/easymesh-parser.y"
    745775    { mc.m_mesh.MirrorY(); }
     
    748778  case 56:
    749779
    750 /* Line 677 of lalr1.cc  */
     780/* Line 690 of lalr1.cc  */
    751781#line 158 "easymesh/easymesh-parser.y"
    752782    { mc.m_mesh.MirrorZ(); }
     
    755785  case 57:
    756786
    757 /* Line 677 of lalr1.cc  */
     787/* Line 690 of lalr1.cc  */
    758788#line 159 "easymesh/easymesh-parser.y"
    759789    { mc.m_mesh.RadialJitter((yysemantic_stack_[(2) - (2)].args).f0); }
     
    762792  case 58:
    763793
    764 /* Line 677 of lalr1.cc  */
     794/* Line 690 of lalr1.cc  */
    765795#line 160 "easymesh/easymesh-parser.y"
    766796    { mc.m_mesh.SplitTriangles((yysemantic_stack_[(2) - (2)].args).f0); }
     
    769799  case 59:
    770800
    771 /* Line 677 of lalr1.cc  */
     801/* Line 690 of lalr1.cc  */
    772802#line 161 "easymesh/easymesh-parser.y"
    773803    { mc.m_mesh.SmoothMesh((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     
    776806  case 60:
    777807
    778 /* Line 677 of lalr1.cc  */
     808/* Line 690 of lalr1.cc  */
    779809#line 162 "easymesh/easymesh-parser.y"
    780810    { mc.m_mesh.ToggleScaleWinding(); }
     
    783813  case 61:
    784814
    785 /* Line 677 of lalr1.cc  */
     815/* Line 690 of lalr1.cc  */
    786816#line 163 "easymesh/easymesh-parser.y"
    787817    { mc.m_mesh.CsgUnion(); }
     
    790820  case 62:
    791821
    792 /* Line 677 of lalr1.cc  */
     822/* Line 690 of lalr1.cc  */
    793823#line 164 "easymesh/easymesh-parser.y"
    794824    { mc.m_mesh.CsgSubstract(); }
     
    797827  case 63:
    798828
    799 /* Line 677 of lalr1.cc  */
     829/* Line 690 of lalr1.cc  */
    800830#line 165 "easymesh/easymesh-parser.y"
    801831    { mc.m_mesh.CsgSubstractLoss(); }
     
    804834  case 64:
    805835
    806 /* Line 677 of lalr1.cc  */
     836/* Line 690 of lalr1.cc  */
    807837#line 166 "easymesh/easymesh-parser.y"
    808838    { mc.m_mesh.CsgAnd(); }
     
    811841  case 65:
    812842
    813 /* Line 677 of lalr1.cc  */
     843/* Line 690 of lalr1.cc  */
    814844#line 167 "easymesh/easymesh-parser.y"
    815845    { mc.m_mesh.CsgXor(); }
     
    818848  case 66:
    819849
    820 /* Line 677 of lalr1.cc  */
     850/* Line 690 of lalr1.cc  */
    821851#line 171 "easymesh/easymesh-parser.y"
    822852    { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
     
    827857  case 67:
    828858
    829 /* Line 677 of lalr1.cc  */
     859/* Line 690 of lalr1.cc  */
    830860#line 174 "easymesh/easymesh-parser.y"
    831861    { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
     
    836866  case 68:
    837867
    838 /* Line 677 of lalr1.cc  */
     868/* Line 690 of lalr1.cc  */
    839869#line 177 "easymesh/easymesh-parser.y"
    840870    { mc.m_mesh.AppendBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); }
     
    843873  case 69:
    844874
    845 /* Line 677 of lalr1.cc  */
     875/* Line 690 of lalr1.cc  */
    846876#line 178 "easymesh/easymesh-parser.y"
    847877    { mc.m_mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
     
    851881  case 70:
    852882
    853 /* Line 677 of lalr1.cc  */
     883/* Line 690 of lalr1.cc  */
    854884#line 180 "easymesh/easymesh-parser.y"
    855885    { mc.m_mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
     
    859889  case 71:
    860890
    861 /* Line 677 of lalr1.cc  */
     891/* Line 690 of lalr1.cc  */
    862892#line 182 "easymesh/easymesh-parser.y"
    863893    { mc.m_mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); }
     
    866896  case 72:
    867897
    868 /* Line 677 of lalr1.cc  */
     898/* Line 690 of lalr1.cc  */
    869899#line 183 "easymesh/easymesh-parser.y"
    870900    { mc.m_mesh.AppendCapsule((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     
    873903  case 73:
    874904
    875 /* Line 677 of lalr1.cc  */
     905/* Line 690 of lalr1.cc  */
    876906#line 184 "easymesh/easymesh-parser.y"
    877907    { mc.m_mesh.AppendTorus((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); }
     
    880910  case 74:
    881911
    882 /* Line 677 of lalr1.cc  */
     912/* Line 690 of lalr1.cc  */
    883913#line 185 "easymesh/easymesh-parser.y"
    884914    { mc.m_mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2,
     
    888918  case 75:
    889919
    890 /* Line 677 of lalr1.cc  */
     920/* Line 690 of lalr1.cc  */
    891921#line 187 "easymesh/easymesh-parser.y"
    892922    { mc.m_mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
     
    896926  case 76:
    897927
    898 /* Line 677 of lalr1.cc  */
     928/* Line 690 of lalr1.cc  */
    899929#line 189 "easymesh/easymesh-parser.y"
    900930    { mc.m_mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); }
     
    903933  case 77:
    904934
    905 /* Line 677 of lalr1.cc  */
     935/* Line 690 of lalr1.cc  */
    906936#line 190 "easymesh/easymesh-parser.y"
    907937    { mc.m_mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
     
    910940  case 78:
    911941
    912 /* Line 677 of lalr1.cc  */
     942/* Line 690 of lalr1.cc  */
    913943#line 191 "easymesh/easymesh-parser.y"
    914944    { mc.m_mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); }
     
    917947  case 79:
    918948
    919 /* Line 677 of lalr1.cc  */
     949/* Line 690 of lalr1.cc  */
    920950#line 192 "easymesh/easymesh-parser.y"
    921951    { mc.m_mesh.AppendCog((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1,
     
    926956  case 80:
    927957
    928 /* Line 677 of lalr1.cc  */
     958/* Line 690 of lalr1.cc  */
    929959#line 197 "easymesh/easymesh-parser.y"
    930960    { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); }
     
    933963  case 81:
    934964
    935 /* Line 677 of lalr1.cc  */
     965/* Line 690 of lalr1.cc  */
    936966#line 198 "easymesh/easymesh-parser.y"
    937967    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(2) - (2)].fval); }
     
    940970  case 82:
    941971
    942 /* Line 677 of lalr1.cc  */
     972/* Line 690 of lalr1.cc  */
    943973#line 199 "easymesh/easymesh-parser.y"
    944974    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(2) - (2)].fval); }
     
    947977  case 83:
    948978
    949 /* Line 677 of lalr1.cc  */
     979/* Line 690 of lalr1.cc  */
    950980#line 200 "easymesh/easymesh-parser.y"
    951981    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(2) - (2)].fval); }
     
    954984  case 84:
    955985
    956 /* Line 677 of lalr1.cc  */
     986/* Line 690 of lalr1.cc  */
    957987#line 201 "easymesh/easymesh-parser.y"
    958988    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(2) - (2)].fval); }
     
    961991  case 85:
    962992
    963 /* Line 677 of lalr1.cc  */
     993/* Line 690 of lalr1.cc  */
    964994#line 202 "easymesh/easymesh-parser.y"
    965995    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(2) - (2)].fval); }
     
    968998  case 86:
    969999
    970 /* Line 677 of lalr1.cc  */
     1000/* Line 690 of lalr1.cc  */
    9711001#line 203 "easymesh/easymesh-parser.y"
    9721002    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(2) - (2)].fval); }
     
    9751005  case 87:
    9761006
    977 /* Line 677 of lalr1.cc  */
     1007/* Line 690 of lalr1.cc  */
    9781008#line 204 "easymesh/easymesh-parser.y"
    9791009    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(2) - (2)].fval); }
     
    9821012  case 88:
    9831013
    984 /* Line 677 of lalr1.cc  */
     1014/* Line 690 of lalr1.cc  */
    9851015#line 205 "easymesh/easymesh-parser.y"
    9861016    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f8 = (yysemantic_stack_[(2) - (2)].fval); }
     
    9891019  case 89:
    9901020
    991 /* Line 677 of lalr1.cc  */
     1021/* Line 690 of lalr1.cc  */
    9921022#line 206 "easymesh/easymesh-parser.y"
    9931023    { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f9 = (yysemantic_stack_[(2) - (2)].fval); }
     
    9961026  case 90:
    9971027
    998 /* Line 677 of lalr1.cc  */
     1028/* Line 690 of lalr1.cc  */
    9991029#line 209 "easymesh/easymesh-parser.y"
    10001030    { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); }
     
    10031033  case 91:
    10041034
    1005 /* Line 677 of lalr1.cc  */
     1035/* Line 690 of lalr1.cc  */
    10061036#line 210 "easymesh/easymesh-parser.y"
    10071037    { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); }
     
    10101040
    10111041
    1012 /* Line 677 of lalr1.cc  */
    1013 #line 1014 "generated/easymesh-parser.cpp"
     1042/* Line 690 of lalr1.cc  */
     1043#line 1044 "generated/easymesh-parser.cpp"
    10141044        default:
    10151045          break;
    10161046      }
     1047    /* User semantic actions sometimes alter yychar, and that requires
     1048       that yytoken be updated with the new translation.  We take the
     1049       approach of translating immediately before every use of yytoken.
     1050       One alternative is translating here after every semantic action,
     1051       but that translation would be missed if the semantic action
     1052       invokes YYABORT, YYACCEPT, or YYERROR immediately after altering
     1053       yychar.  In the case of YYABORT or YYACCEPT, an incorrect
     1054       destructor might then be invoked immediately.  In the case of
     1055       YYERROR, subsequent parser actions might lead to an incorrect
     1056       destructor call or verbose syntax error message before the
     1057       lookahead is translated.  */
    10171058    YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
    10181059
     
    10381079  `------------------------------------*/
    10391080  yyerrlab:
     1081    /* Make sure we have latest lookahead translation.  See comments at
     1082       user semantic actions for why this is necessary.  */
     1083    yytoken = yytranslate_ (yychar);
     1084
    10401085    /* If not already recovering from an error, report this error.  */
    10411086    if (!yyerrstatus_)
    10421087      {
    10431088        ++yynerrs_;
     1089        if (yychar == yyempty_)
     1090          yytoken = yyempty_;
    10441091        error (yylloc, yysyntax_error_ (yystate, yytoken));
    10451092      }
    10461093
    1047     yyerror_range[0] = yylloc;
     1094    yyerror_range[1] = yylloc;
    10481095    if (yyerrstatus_ == 3)
    10491096      {
     
    10801127      goto yyerrorlab;
    10811128
    1082     yyerror_range[0] = yylocation_stack_[yylen - 1];
     1129    yyerror_range[1] = yylocation_stack_[yylen - 1];
    10831130    /* Do not reclaim the symbols of the rule which action triggered
    10841131       this YYERROR.  */
     
    10971144      {
    10981145        yyn = yypact_[yystate];
    1099         if (yyn != yypact_ninf_)
     1146        if (!yy_pact_value_is_default_ (yyn))
    11001147        {
    11011148          yyn += yyterror_;
     
    11121159        YYABORT;
    11131160
    1114         yyerror_range[0] = yylocation_stack_[0];
     1161        yyerror_range[1] = yylocation_stack_[0];
    11151162        yydestruct_ ("Error: popping",
    11161163                     yystos_[yystate],
     
    11211168      }
    11221169
    1123     yyerror_range[1] = yylloc;
     1170    yyerror_range[2] = yylloc;
    11241171    // Using YYLLOC is tempting, but would change the location of
    11251172    // the lookahead.  YYLOC is available though.
    1126     YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
     1173    YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
    11271174    yysemantic_stack_.push (yylval);
    11281175    yylocation_stack_.push (yyloc);
     
    11471194  yyreturn:
    11481195    if (yychar != yyempty_)
    1149       yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
     1196      {
     1197        /* Make sure we have latest lookahead translation.  See comments
     1198           at user semantic actions for why this is necessary.  */
     1199        yytoken = yytranslate_ (yychar);
     1200        yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval,
     1201                     &yylloc);
     1202      }
    11501203
    11511204    /* Do not reclaim the symbols of the rule which action triggered
     
    11661219  // Generate an error message.
    11671220  std::string
    1168   EasyMeshParser::yysyntax_error_ (int yystate, int tok)
    1169   {
    1170     std::string res;
    1171     YYUSE (yystate);
    1172 #if YYERROR_VERBOSE
    1173     int yyn = yypact_[yystate];
    1174     if (yypact_ninf_ < yyn && yyn <= yylast_)
     1221  EasyMeshParser::yysyntax_error_ (int yystate, int yytoken)
     1222  {
     1223    std::string yyres;
     1224    // Number of reported tokens (one for the "unexpected", one per
     1225    // "expected").
     1226    size_t yycount = 0;
     1227    // Its maximum.
     1228    enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
     1229    // Arguments of yyformat.
     1230    char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
     1231
     1232    /* There are many possibilities here to consider:
     1233       - If this state is a consistent state with a default action, then
     1234         the only way this function was invoked is if the default action
     1235         is an error action.  In that case, don't check for expected
     1236         tokens because there are none.
     1237       - The only way there can be no lookahead present (in yytoken) is
     1238         if this state is a consistent state with a default action.
     1239         Thus, detecting the absence of a lookahead is sufficient to
     1240         determine that there is no unexpected or expected token to
     1241         report.  In that case, just report a simple "syntax error".
     1242       - Don't assume there isn't a lookahead just because this state is
     1243         a consistent state with a default action.  There might have
     1244         been a previous inconsistent state, consistent state with a
     1245         non-default action, or user semantic action that manipulated
     1246         yychar.
     1247       - Of course, the expected token list depends on states to have
     1248         correct lookahead information, and it depends on the parser not
     1249         to perform extra reductions after fetching a lookahead from the
     1250         scanner and before detecting a syntax error.  Thus, state
     1251         merging (from LALR or IELR) and default reductions corrupt the
     1252         expected token list.  However, the list is correct for
     1253         canonical LR with one exception: it will still contain any
     1254         token that will not be accepted due to an error action in a
     1255         later state.
     1256    */
     1257    if (yytoken != yyempty_)
    11751258      {
    1176         /* Start YYX at -YYN if negative to avoid negative indexes in
    1177            YYCHECK.  */
    1178         int yyxbegin = yyn < 0 ? -yyn : 0;
    1179 
    1180         /* Stay within bounds of both yycheck and yytname.  */
    1181         int yychecklim = yylast_ - yyn + 1;
    1182         int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
    1183         int count = 0;
    1184         for (int x = yyxbegin; x < yyxend; ++x)
    1185           if (yycheck_[x + yyn] == x && x != yyterror_)
    1186             ++count;
    1187 
    1188         // FIXME: This method of building the message is not compatible
    1189         // with internationalization.  It should work like yacc.c does it.
    1190         // That is, first build a string that looks like this:
    1191         // "syntax error, unexpected %s or %s or %s"
    1192         // Then, invoke YY_ on this string.
    1193         // Finally, use the string as a format to output
    1194         // yytname_[tok], etc.
    1195         // Until this gets fixed, this message appears in English only.
    1196         res = "syntax error, unexpected ";
    1197         res += yytnamerr_ (yytname_[tok]);
    1198         if (count < 5)
    1199           {
    1200             count = 0;
    1201             for (int x = yyxbegin; x < yyxend; ++x)
    1202               if (yycheck_[x + yyn] == x && x != yyterror_)
    1203                 {
    1204                   res += (!count++) ? ", expecting " : " or ";
    1205                   res += yytnamerr_ (yytname_[x]);
    1206                 }
    1207           }
     1259        yyarg[yycount++] = yytname_[yytoken];
     1260        int yyn = yypact_[yystate];
     1261        if (!yy_pact_value_is_default_ (yyn))
     1262          {
     1263            /* Start YYX at -YYN if negative to avoid negative indexes in
     1264               YYCHECK.  In other words, skip the first -YYN actions for
     1265               this state because they are default actions.  */
     1266            int yyxbegin = yyn < 0 ? -yyn : 0;
     1267            /* Stay within bounds of both yycheck and yytname.  */
     1268            int yychecklim = yylast_ - yyn + 1;
     1269            int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
     1270            for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
     1271              if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
     1272                  && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
     1273                {
     1274                  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
     1275                    {
     1276                      yycount = 1;
     1277                      break;
     1278                    }
     1279                  else
     1280                    yyarg[yycount++] = yytname_[yyx];
     1281                }
     1282          }
    12081283      }
    1209     else
    1210 #endif
    1211       res = YY_("syntax error");
    1212     return res;
     1284
     1285    char const* yyformat = 0;
     1286    switch (yycount)
     1287      {
     1288#define YYCASE_(N, S)                         \
     1289        case N:                               \
     1290          yyformat = S;                       \
     1291        break
     1292        YYCASE_(0, YY_("syntax error"));
     1293        YYCASE_(1, YY_("syntax error, unexpected %s"));
     1294        YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
     1295        YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
     1296        YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
     1297        YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
     1298#undef YYCASE_
     1299      }
     1300
     1301    // Argument number.
     1302    size_t yyi = 0;
     1303    for (char const* yyp = yyformat; *yyp; ++yyp)
     1304      if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
     1305        {
     1306          yyres += yytnamerr_ (yyarg[yyi++]);
     1307          ++yyp;
     1308        }
     1309      else
     1310        yyres += *yyp;
     1311    return yyres;
    12131312  }
    12141313
     
    12381337  };
    12391338
    1240   /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
    1241      doesn't specify something else to do.  Zero means the default is an
    1242      error.  */
     1339  /* YYDEFACT[S] -- default reduction number in state S.  Performed when
     1340     YYTABLE doesn't specify something else to do.  Zero means the
     1341     default is an error.  */
    12431342  const unsigned char
    12441343  EasyMeshParser::yydefact_[] =
     
    12821381  /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    12831382     positive, shift that token.  If negative, reduce the rule which
    1284      number is the opposite.  If zero, do what YYDEFACT says.  */
     1383     number is the opposite.  If YYTABLE_NINF_, syntax error.  */
    12851384  const signed char EasyMeshParser::yytable_ninf_ = -1;
    12861385  const unsigned char
     
    16061705} // lol
    16071706
    1608 /* Line 1053 of lalr1.cc  */
    1609 #line 1610 "generated/easymesh-parser.cpp"
    1610 
    1611 
    1612 /* Line 1055 of lalr1.cc  */
     1707/* Line 1136 of lalr1.cc  */
     1708#line 1709 "generated/easymesh-parser.cpp"
     1709
     1710
     1711/* Line 1138 of lalr1.cc  */
    16131712#line 213 "easymesh/easymesh-parser.y"
    16141713
  • trunk/src/generated/easymesh-parser.h

    r2410 r2506  
    1 /* A Bison parser, made by GNU Bison 2.4.2.  */
     1/* A Bison parser, made by GNU Bison 2.5.  */
    22
    33/* Skeleton interface for Bison LALR(1) parsers in C++
    44   
    5       Copyright (C) 2002-2010 Free Software Foundation, Inc.
     5      Copyright (C) 2002-2011 Free Software Foundation, Inc.
    66   
    77   This program is free software: you can redistribute it and/or modify
     
    4141#include <iostream>
    4242#include "stack.hh"
    43 
    44 
    45 namespace lol {
    46 
    47 /* Line 34 of lalr1.cc  */
    48 #line 49 "generated/easymesh-parser.h"
    49   class position;
    50   class location;
    51 
    52 } // lol
    53 
    54 /* Line 34 of lalr1.cc  */
    55 #line 56 "generated/easymesh-parser.h"
    56 
    5743#include "location.hh"
    5844
     
    7561#endif
    7662
    77 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
    78    If N is 0, then set CURRENT to the empty location which ends
    79    the previous symbol: RHS[0] (always defined).  */
    80 
    81 #ifndef YYLLOC_DEFAULT
    82 # define YYLLOC_DEFAULT(Current, Rhs, N)                \
    83 do {                                                    \
    84   if (N)                                                \
    85     {                                                   \
    86       (Current).begin = (Rhs)[1].begin;                 \
    87       (Current).end   = (Rhs)[N].end;                   \
    88     }                                                   \
    89   else                                                  \
    90     {                                                   \
    91       (Current).begin = (Current).end = (Rhs)[0].end;   \
    92     }                                                   \
    93 } while (false)
    94 #endif
    95 
    9663
    9764namespace lol {
    9865
    99 /* Line 34 of lalr1.cc  */
    100 #line 101 "generated/easymesh-parser.h"
     66/* Line 35 of lalr1.cc  */
     67#line 68 "generated/easymesh-parser.h"
    10168
    10269  /// A Bison parser.
     
    10976    {
    11077
    111 /* Line 34 of lalr1.cc  */
     78/* Line 35 of lalr1.cc  */
    11279#line 36 "easymesh/easymesh-parser.y"
    11380
     
    11986
    12087
    121 /* Line 34 of lalr1.cc  */
    122 #line 123 "generated/easymesh-parser.h"
     88/* Line 35 of lalr1.cc  */
     89#line 90 "generated/easymesh-parser.h"
    12390    };
    12491#else
     
    266233    location_stack_type yylocation_stack_;
    267234
     235    /// Whether the given \c yypact_ value indicates a defaulted state.
     236    /// \param yyvalue   the value to check
     237    static bool yy_pact_value_is_default_ (int yyvalue);
     238
     239    /// Whether the given \c yytable_ value indicates a syntax error.
     240    /// \param yyvalue   the value to check
     241    static bool yy_table_value_is_error_ (int yyvalue);
     242
    268243    /// Internal symbol numbers.
    269244    typedef unsigned char token_number_type;
     
    273248    static const signed char yypact_ninf_;
    274249
    275     /// For a state, default rule to reduce.
     250    /// For a state, default reduction number.
    276251    /// Unless\a  yytable_ specifies something else to do.
    277252    /// Zero means the default is an error.
     
    304279#endif
    305280
    306 #if YYERROR_VERBOSE
    307281    /// Convert the symbol name \a n to a form suitable for a diagnostic.
    308     virtual std::string yytnamerr_ (const char *n);
    309 #endif
     282    static std::string yytnamerr_ (const char *n);
    310283
    311284#if YYDEBUG
     
    365338} // lol
    366339
    367 /* Line 34 of lalr1.cc  */
    368 #line 369 "generated/easymesh-parser.h"
     340/* Line 35 of lalr1.cc  */
     341#line 342 "generated/easymesh-parser.h"
    369342
    370343
  • trunk/src/generated/location.hh

    r2410 r2506  
    1 /* A Bison parser, made by GNU Bison 2.4.2.  */
     1/* A Bison parser, made by GNU Bison 2.5.  */
    22
    33/* Locations for Bison parsers in C++
    44   
    5       Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc.
     5      Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
    66   
    77   This program is free software: you can redistribute it and/or modify
  • trunk/src/generated/lolfx-parser.cpp

    r2410 r2506  
    1 /* A Bison parser, made by GNU Bison 2.4.2.  */
     1/* A Bison parser, made by GNU Bison 2.5.  */
    22
    33/* Skeleton implementation for Bison LALR(1) parsers in C++
    44   
    5       Copyright (C) 2002-2010 Free Software Foundation, Inc.
     5      Copyright (C) 2002-2011 Free Software Foundation, Inc.
    66   
    77   This program is free software: you can redistribute it and/or modify
     
    3636/* First part of user declarations.  */
    3737
    38 /* Line 310 of lalr1.cc  */
     38/* Line 293 of lalr1.cc  */
    3939#line 1 "gpu/lolfx-parser.y"
    4040
     
    5959
    6060
    61 /* Line 310 of lalr1.cc  */
     61/* Line 293 of lalr1.cc  */
    6262#line 63 "generated/lolfx-parser.cpp"
    6363
     
    6767/* User implementation prologue.  */
    6868
    69 /* Line 316 of lalr1.cc  */
     69/* Line 299 of lalr1.cc  */
    7070#line 241 "gpu/lolfx-parser.y"
    7171
     
    7676
    7777
    78 /* Line 316 of lalr1.cc  */
     78/* Line 299 of lalr1.cc  */
    7979#line 80 "generated/lolfx-parser.cpp"
    8080
     
    9191#endif
    9292
     93/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
     94   If N is 0, then set CURRENT to the empty location which ends
     95   the previous symbol: RHS[0] (always defined).  */
     96
     97#define YYRHSLOC(Rhs, K) ((Rhs)[K])
     98#ifndef YYLLOC_DEFAULT
     99# define YYLLOC_DEFAULT(Current, Rhs, N)                               \
     100 do                                                                    \
     101   if (N)                                                              \
     102     {                                                                 \
     103       (Current).begin = YYRHSLOC (Rhs, 1).begin;                      \
     104       (Current).end   = YYRHSLOC (Rhs, N).end;                        \
     105     }                                                                 \
     106   else                                                                \
     107     {                                                                 \
     108       (Current).begin = (Current).end = YYRHSLOC (Rhs, 0).end;        \
     109     }                                                                 \
     110 while (false)
     111#endif
     112
    93113/* Suppress unused-variable warnings by "using" E.  */
    94114#define YYUSE(e) ((void) (e))
     
    142162namespace lol {
    143163
    144 /* Line 379 of lalr1.cc  */
    145 #line 146 "generated/lolfx-parser.cpp"
    146 #if YYERROR_VERBOSE
     164/* Line 382 of lalr1.cc  */
     165#line 166 "generated/lolfx-parser.cpp"
    147166
    148167  /* Return YYSTR after stripping away unnecessary quotes and
     
    183202  }
    184203
    185 #endif
    186204
    187205  /// Build a parser object.
     
    284302#endif
    285303
     304  inline bool
     305  LolFxParser::yy_pact_value_is_default_ (int yyvalue)
     306  {
     307    return yyvalue == yypact_ninf_;
     308  }
     309
     310  inline bool
     311  LolFxParser::yy_table_value_is_error_ (int yyvalue)
     312  {
     313    return yyvalue == yytable_ninf_;
     314  }
     315
    286316  int
    287317  LolFxParser::parse ()
     
    305335    location_type yylloc;
    306336    /// The locations where the error started and ended.
    307     location_type yyerror_range[2];
     337    location_type yyerror_range[3];
    308338
    309339    /// $$.
     
    343373    /* Try to take a decision without lookahead.  */
    344374    yyn = yypact_[yystate];
    345     if (yyn == yypact_ninf_)
     375    if (yy_pact_value_is_default_ (yyn))
    346376      goto yydefault;
    347377
     
    376406    if (yyn <= 0)
    377407      {
    378         if (yyn == 0 || yyn == yytable_ninf_)
    379         goto yyerrlab;
     408        if (yy_table_value_is_error_ (yyn))
     409          goto yyerrlab;
    380410        yyn = -yyn;
    381411        goto yyreduce;
     
    433463          case 202:
    434464
    435 /* Line 677 of lalr1.cc  */
     465/* Line 690 of lalr1.cc  */
    436466#line 728 "gpu/lolfx-parser.y"
    437467    { std::cout << "New tech " << std::endl; }
     
    440470  case 203:
    441471
    442 /* Line 677 of lalr1.cc  */
     472/* Line 690 of lalr1.cc  */
    443473#line 736 "gpu/lolfx-parser.y"
    444474    { std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; }
     
    447477  case 204:
    448478
    449 /* Line 677 of lalr1.cc  */
     479/* Line 690 of lalr1.cc  */
    450480#line 737 "gpu/lolfx-parser.y"
    451481    { std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; }
     
    454484  case 207:
    455485
    456 /* Line 677 of lalr1.cc  */
     486/* Line 690 of lalr1.cc  */
    457487#line 750 "gpu/lolfx-parser.y"
    458488    { std::cout << "New pass " << std::endl; }
     
    461491  case 226:
    462492
    463 /* Line 677 of lalr1.cc  */
     493/* Line 690 of lalr1.cc  */
    464494#line 786 "gpu/lolfx-parser.y"
    465495    { std::cout << "new shader" << std::endl; }
     
    468498
    469499
    470 /* Line 677 of lalr1.cc  */
    471 #line 472 "generated/lolfx-parser.cpp"
     500/* Line 690 of lalr1.cc  */
     501#line 502 "generated/lolfx-parser.cpp"
    472502        default:
    473503          break;
    474504      }
     505    /* User semantic actions sometimes alter yychar, and that requires
     506       that yytoken be updated with the new translation.  We take the
     507       approach of translating immediately before every use of yytoken.
     508       One alternative is translating here after every semantic action,
     509       but that translation would be missed if the semantic action
     510       invokes YYABORT, YYACCEPT, or YYERROR immediately after altering
     511       yychar.  In the case of YYABORT or YYACCEPT, an incorrect
     512       destructor might then be invoked immediately.  In the case of
     513       YYERROR, subsequent parser actions might lead to an incorrect
     514       destructor call or verbose syntax error message before the
     515       lookahead is translated.  */
    475516    YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc);
    476517
     
    496537  `------------------------------------*/
    497538  yyerrlab:
     539    /* Make sure we have latest lookahead translation.  See comments at
     540       user semantic actions for why this is necessary.  */
     541    yytoken = yytranslate_ (yychar);
     542
    498543    /* If not already recovering from an error, report this error.  */
    499544    if (!yyerrstatus_)
    500545      {
    501546        ++yynerrs_;
     547        if (yychar == yyempty_)
     548          yytoken = yyempty_;
    502549        error (yylloc, yysyntax_error_ (yystate, yytoken));
    503550      }
    504551
    505     yyerror_range[0] = yylloc;
     552    yyerror_range[1] = yylloc;
    506553    if (yyerrstatus_ == 3)
    507554      {
     
    538585      goto yyerrorlab;
    539586
    540     yyerror_range[0] = yylocation_stack_[yylen - 1];
     587    yyerror_range[1] = yylocation_stack_[yylen - 1];
    541588    /* Do not reclaim the symbols of the rule which action triggered
    542589       this YYERROR.  */
     
    555602      {
    556603        yyn = yypact_[yystate];
    557         if (yyn != yypact_ninf_)
     604        if (!yy_pact_value_is_default_ (yyn))
    558605        {
    559606          yyn += yyterror_;
     
    570617        YYABORT;
    571618
    572         yyerror_range[0] = yylocation_stack_[0];
     619        yyerror_range[1] = yylocation_stack_[0];
    573620        yydestruct_ ("Error: popping",
    574621                     yystos_[yystate],
     
    579626      }
    580627
    581     yyerror_range[1] = yylloc;
     628    yyerror_range[2] = yylloc;
    582629    // Using YYLLOC is tempting, but would change the location of
    583630    // the lookahead.  YYLOC is available though.
    584     YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);
     631    YYLLOC_DEFAULT (yyloc, yyerror_range, 2);
    585632    yysemantic_stack_.push (yylval);
    586633    yylocation_stack_.push (yyloc);
     
    605652  yyreturn:
    606653    if (yychar != yyempty_)
    607       yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc);
     654      {
     655        /* Make sure we have latest lookahead translation.  See comments
     656           at user semantic actions for why this is necessary.  */
     657        yytoken = yytranslate_ (yychar);
     658        yydestruct_ ("Cleanup: discarding lookahead", yytoken, &yylval,
     659                     &yylloc);
     660      }
    608661
    609662    /* Do not reclaim the symbols of the rule which action triggered
     
    624677  // Generate an error message.
    625678  std::string
    626   LolFxParser::yysyntax_error_ (int yystate, int tok)
     679  LolFxParser::yysyntax_error_ (int yystate, int yytoken)
    627680  {
    628     std::string res;
    629     YYUSE (yystate);
    630 #if YYERROR_VERBOSE
    631     int yyn = yypact_[yystate];
    632     if (yypact_ninf_ < yyn && yyn <= yylast_)
     681    std::string yyres;
     682    // Number of reported tokens (one for the "unexpected", one per
     683    // "expected").
     684    size_t yycount = 0;
     685    // Its maximum.
     686    enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
     687    // Arguments of yyformat.
     688    char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
     689
     690    /* There are many possibilities here to consider:
     691       - If this state is a consistent state with a default action, then
     692         the only way this function was invoked is if the default action
     693         is an error action.  In that case, don't check for expected
     694         tokens because there are none.
     695       - The only way there can be no lookahead present (in yytoken) is
     696         if this state is a consistent state with a default action.
     697         Thus, detecting the absence of a lookahead is sufficient to
     698         determine that there is no unexpected or expected token to
     699         report.  In that case, just report a simple "syntax error".
     700       - Don't assume there isn't a lookahead just because this state is
     701         a consistent state with a default action.  There might have
     702         been a previous inconsistent state, consistent state with a
     703         non-default action, or user semantic action that manipulated
     704         yychar.
     705       - Of course, the expected token list depends on states to have
     706         correct lookahead information, and it depends on the parser not
     707         to perform extra reductions after fetching a lookahead from the
     708         scanner and before detecting a syntax error.  Thus, state
     709         merging (from LALR or IELR) and default reductions corrupt the
     710         expected token list.  However, the list is correct for
     711         canonical LR with one exception: it will still contain any
     712         token that will not be accepted due to an error action in a
     713         later state.
     714    */
     715    if (yytoken != yyempty_)
    633716      {
    634         /* Start YYX at -YYN if negative to avoid negative indexes in
    635            YYCHECK.  */
    636         int yyxbegin = yyn < 0 ? -yyn : 0;
    637 
    638         /* Stay within bounds of both yycheck and yytname.  */
    639         int yychecklim = yylast_ - yyn + 1;
    640         int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
    641         int count = 0;
    642         for (int x = yyxbegin; x < yyxend; ++x)
    643           if (yycheck_[x + yyn] == x && x != yyterror_)
    644             ++count;
    645 
    646         // FIXME: This method of building the message is not compatible
    647         // with internationalization.  It should work like yacc.c does it.
    648         // That is, first build a string that looks like this:
    649         // "syntax error, unexpected %s or %s or %s"
    650         // Then, invoke YY_ on this string.
    651         // Finally, use the string as a format to output
    652         // yytname_[tok], etc.
    653         // Until this gets fixed, this message appears in English only.
    654         res = "syntax error, unexpected ";
    655         res += yytnamerr_ (yytname_[tok]);
    656         if (count < 5)
    657           {
    658             count = 0;
    659             for (int x = yyxbegin; x < yyxend; ++x)
    660               if (yycheck_[x + yyn] == x && x != yyterror_)
    661                 {
    662                   res += (!count++) ? ", expecting " : " or ";
    663                   res += yytnamerr_ (yytname_[x]);
    664                 }
    665           }
     717        yyarg[yycount++] = yytname_[yytoken];
     718        int yyn = yypact_[yystate];
     719        if (!yy_pact_value_is_default_ (yyn))
     720          {
     721            /* Start YYX at -YYN if negative to avoid negative indexes in
     722               YYCHECK.  In other words, skip the first -YYN actions for
     723               this state because they are default actions.  */
     724            int yyxbegin = yyn < 0 ? -yyn : 0;
     725            /* Stay within bounds of both yycheck and yytname.  */
     726            int yychecklim = yylast_ - yyn + 1;
     727            int yyxend = yychecklim < yyntokens_ ? yychecklim : yyntokens_;
     728            for (int yyx = yyxbegin; yyx < yyxend; ++yyx)
     729              if (yycheck_[yyx + yyn] == yyx && yyx != yyterror_
     730                  && !yy_table_value_is_error_ (yytable_[yyx + yyn]))
     731                {
     732                  if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
     733                    {
     734                      yycount = 1;
     735                      break;
     736                    }
     737                  else
     738                    yyarg[yycount++] = yytname_[yyx];
     739                }
     740          }
    666741      }
    667     else
    668 #endif
    669       res = YY_("syntax error");
    670     return res;
     742
     743    char const* yyformat = 0;
     744    switch (yycount)
     745      {
     746#define YYCASE_(N, S)                         \
     747        case N:                               \
     748          yyformat = S;                       \
     749        break
     750        YYCASE_(0, YY_("syntax error"));
     751        YYCASE_(1, YY_("syntax error, unexpected %s"));
     752        YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
     753        YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
     754        YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
     755        YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
     756#undef YYCASE_
     757      }
     758
     759    // Argument number.
     760    size_t yyi = 0;
     761    for (char const* yyp = yyformat; *yyp; ++yyp)
     762      if (yyp[0] == '%' && yyp[1] == 's' && yyi < yycount)
     763        {
     764          yyres += yytnamerr_ (yyarg[yyi++]);
     765          ++yyp;
     766        }
     767      else
     768        yyres += *yyp;
     769    return yyres;
    671770  }
    672771
     
    747846  };
    748847
    749   /* YYDEFACT[S] -- default rule to reduce with in state S when YYTABLE
    750      doesn't specify something else to do.  Zero means the default is an
    751      error.  */
     848  /* YYDEFACT[S] -- default reduction number in state S.  Performed when
     849     YYTABLE doesn't specify something else to do.  Zero means the
     850     default is an error.  */
    752851  const unsigned short int
    753852  LolFxParser::yydefact_[] =
     
    856955  /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    857956     positive, shift that token.  If negative, reduce the rule which
    858      number is the opposite.  If zero, do what YYDEFACT says.  */
     957     number is the opposite.  If YYTABLE_NINF_, syntax error.  */
    859958  const short int LolFxParser::yytable_ninf_ = -323;
    860959  const short int
     
    37923891} // lol
    37933892
    3794 /* Line 1053 of lalr1.cc  */
    3795 #line 3796 "generated/lolfx-parser.cpp"
    3796 
    3797 
    3798 /* Line 1055 of lalr1.cc  */
     3893/* Line 1136 of lalr1.cc  */
     3894#line 3895 "generated/lolfx-parser.cpp"
     3895
     3896
     3897/* Line 1138 of lalr1.cc  */
    37993898#line 1298 "gpu/lolfx-parser.y"
    38003899
  • trunk/src/generated/lolfx-parser.h

    r2410 r2506  
    1 /* A Bison parser, made by GNU Bison 2.4.2.  */
     1/* A Bison parser, made by GNU Bison 2.5.  */
    22
    33/* Skeleton interface for Bison LALR(1) parsers in C++
    44   
    5       Copyright (C) 2002-2010 Free Software Foundation, Inc.
     5      Copyright (C) 2002-2011 Free Software Foundation, Inc.
    66   
    77   This program is free software: you can redistribute it and/or modify
     
    4141#include <iostream>
    4242#include "stack.hh"
    43 
    44 
    45 namespace lol {
    46 
    47 /* Line 34 of lalr1.cc  */
    48 #line 49 "generated/lolfx-parser.h"
    49   class position;
    50   class location;
    51 
    52 } // lol
    53 
    54 /* Line 34 of lalr1.cc  */
    55 #line 56 "generated/lolfx-parser.h"
    56 
    5743#include "location.hh"
    5844
     
    7561#endif
    7662
    77 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
    78    If N is 0, then set CURRENT to the empty location which ends
    79    the previous symbol: RHS[0] (always defined).  */
    80 
    81 #ifndef YYLLOC_DEFAULT
    82 # define YYLLOC_DEFAULT(Current, Rhs, N)                \
    83 do {                                                    \
    84   if (N)                                                \
    85     {                                                   \
    86       (Current).begin = (Rhs)[1].begin;                 \
    87       (Current).end   = (Rhs)[N].end;                   \
    88     }                                                   \
    89   else                                                  \
    90     {                                                   \
    91       (Current).begin = (Current).end = (Rhs)[0].end;   \
    92     }                                                   \
    93 } while (false)
    94 #endif
    95 
    9663
    9764namespace lol {
    9865
    99 /* Line 34 of lalr1.cc  */
    100 #line 101 "generated/lolfx-parser.h"
     66/* Line 35 of lalr1.cc  */
     67#line 68 "generated/lolfx-parser.h"
    10168
    10269  /// A Bison parser.
     
    10976    {
    11077
    111 /* Line 34 of lalr1.cc  */
     78/* Line 35 of lalr1.cc  */
    11279#line 34 "gpu/lolfx-parser.y"
    11380
     
    11986
    12087
    121 /* Line 34 of lalr1.cc  */
    122 #line 123 "generated/lolfx-parser.h"
     88/* Line 35 of lalr1.cc  */
     89#line 90 "generated/lolfx-parser.h"
    12390    };
    12491#else
     
    641608    location_stack_type yylocation_stack_;
    642609
     610    /// Whether the given \c yypact_ value indicates a defaulted state.
     611    /// \param yyvalue   the value to check
     612    static bool yy_pact_value_is_default_ (int yyvalue);
     613
     614    /// Whether the given \c yytable_ value indicates a syntax error.
     615    /// \param yyvalue   the value to check
     616    static bool yy_table_value_is_error_ (int yyvalue);
     617
    643618    /// Internal symbol numbers.
    644619    typedef unsigned short int token_number_type;
     
    648623    static const short int yypact_ninf_;
    649624
    650     /// For a state, default rule to reduce.
     625    /// For a state, default reduction number.
    651626    /// Unless\a  yytable_ specifies something else to do.
    652627    /// Zero means the default is an error.
     
    679654#endif
    680655
    681 #if YYERROR_VERBOSE
    682656    /// Convert the symbol name \a n to a form suitable for a diagnostic.
    683     virtual std::string yytnamerr_ (const char *n);
    684 #endif
     657    static std::string yytnamerr_ (const char *n);
    685658
    686659#if YYDEBUG
     
    740713} // lol
    741714
    742 /* Line 34 of lalr1.cc  */
    743 #line 744 "generated/lolfx-parser.h"
     715/* Line 35 of lalr1.cc  */
     716#line 717 "generated/lolfx-parser.h"
    744717
    745718
  • trunk/src/generated/position.hh

    r2410 r2506  
    1 /* A Bison parser, made by GNU Bison 2.4.2.  */
     1/* A Bison parser, made by GNU Bison 2.5.  */
    22
    33/* Positions for Bison parsers in C++
    44   
    5       Copyright (C) 2002-2007, 2009-2010 Free Software Foundation, Inc.
     5      Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
    66   
    77   This program is free software: you can redistribute it and/or modify
  • trunk/src/generated/stack.hh

    r2410 r2506  
    1 /* A Bison parser, made by GNU Bison 2.4.2.  */
     1/* A Bison parser, made by GNU Bison 2.5.  */
    22
    33/* Stack handling for Bison parsers in C++
    44   
    5       Copyright (C) 2002-2010 Free Software Foundation, Inc.
     5      Copyright (C) 2002-2011 Free Software Foundation, Inc.
    66   
    77   This program is free software: you can redistribute it and/or modify
     
    3939namespace lol {
    4040
    41 /* Line 1066 of lalr1.cc  */
     41/* Line 1149 of lalr1.cc  */
    4242#line 43 "generated/stack.hh"
    4343  template <class T, class S = std::deque<T> >
     
    129129} // lol
    130130
    131 /* Line 1152 of lalr1.cc  */
     131/* Line 1235 of lalr1.cc  */
    132132#line 133 "generated/stack.hh"
    133133
  • trunk/src/gpu/framebuffer.cpp

    r2480 r2506  
    6868                                          D3DUSAGE_RENDERTARGET,
    6969                                          D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT,
    70                                           &m_data->m_texture, NULL)))
     70                                          &m_data->m_texture, nullptr)))
    7171        Abort();
    7272    if (FAILED(m_data->m_texture->GetSurfaceLevel(0, &m_data->m_surface)))
     
    7575    if (FAILED(g_d3ddevice->CreateTexture(size.x, size.y, 1, 0,
    7676                                          D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT,
    77                                           &m_data->m_texture, NULL)))
     77                                          &m_data->m_texture, nullptr)))
    7878        Abort();
    7979    if (FAILED(g_d3ddevice->CreateRenderTarget(size.x, size.y,
    8080                                               D3DFMT_A8R8G8B8,
    8181                                               D3DMULTISAMPLE_NONE, 0, 0,
    82                                                &m_data->m_surface, NULL)))
     82                                               &m_data->m_surface, nullptr)))
    8383        Abort();
    8484#else
     
    115115    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, (GLenum)filtering);
    116116    glTexImage2D(GL_TEXTURE_2D, 0, internal_format, size.x, size.y, 0,
    117                  format, GL_UNSIGNED_BYTE, NULL);
     117                 format, GL_UNSIGNED_BYTE, nullptr);
    118118
    119119#   if GL_VERSION_1_1 || GL_ES_VERSION_2_0
     
    201201    m_data->m_back_surface->Release();
    202202#elif defined _XBOX
    203     if (FAILED(g_d3ddevice->Resolve(D3DRESOLVE_RENDERTARGET0, NULL,
    204                                     m_data->m_texture, NULL, 0, 0, NULL,
    205                                     0, 0, NULL)))
     203    if (FAILED(g_d3ddevice->Resolve(D3DRESOLVE_RENDERTARGET0, nullptr,
     204                                    m_data->m_texture, nullptr, 0, 0, nullptr,
     205                                    0, 0, nullptr)))
    206206        Abort();
    207207    if (FAILED(g_d3ddevice->SetRenderTarget(0, m_data->m_back_surface)))
  • trunk/src/gpu/indexbuffer.cpp

    r2216 r2506  
    6868    if (FAILED(g_d3ddevice->CreateIndexBuffer(size, D3DUSAGE_WRITEONLY,
    6969                                              D3DFMT_INDEX16, D3DPOOL_MANAGED,
    70                                               &m_data->m_ibo, NULL)))
     70                                              &m_data->m_ibo, nullptr)))
    7171        Abort();
    7272#else
     
    9494{
    9595    if (!m_data->m_size)
    96         return NULL;
     96        return nullptr;
    9797
    9898#if defined USE_D3D9 || defined _XBOX
     
    143143
    144144#if defined USE_D3D9 || defined _XBOX
    145     if (FAILED(g_d3ddevice->SetIndices(NULL)))
     145    if (FAILED(g_d3ddevice->SetIndices(nullptr)))
    146146        Abort();
    147147#else
  • trunk/src/gpu/shader.cpp

    r2291 r2506  
    9292    /* Parse the crap */
    9393    Array<char const *, char const *> sections;
    94     char *key = NULL;
     94    char *key = nullptr;
    9595    for (char *parser = src; *parser; )
    9696    {
    97         if (key == NULL && (parser[0] == '\n' || parser[0] == '\r')
     97        if (key == nullptr && (parser[0] == '\n' || parser[0] == '\r')
    9898             && parser[1] == '[')
    9999        {
     
    110110            sections.Push(key, parser);
    111111            parser++;
    112             key = NULL;
     112            key = nullptr;
    113113        }
    114114        else
     
    118118    }
    119119
    120     char const *vert = NULL, *frag = NULL;
     120    char const *vert = nullptr, *frag = nullptr;
    121121    for (int i = 0; i < sections.Count(); i++)
    122122    {
     
    178178        { "_XBOX", "1" },
    179179#endif
    180         { NULL, NULL }
     180        { nullptr, nullptr }
    181181    };
    182182#elif !defined __CELLOS_LV2__
     
    194194    data->vert_crc = ShaderData::hash(vert);
    195195#if defined USE_D3D9 || defined _XBOX
    196     hr = D3DXCompileShader(vert, (UINT)strlen(vert), macros, NULL, "main",
     196    hr = D3DXCompileShader(vert, (UINT)strlen(vert), macros, nullptr, "main",
    197197                           "vs_3_0", 0, &shader_code, &error_msg,
    198198                           &data->vert_table);
     
    207207    shader_code->Release();
    208208#elif !defined __CELLOS_LV2__
    209     ShaderData::Patch(buf, vert, NULL);
     209    ShaderData::Patch(buf, vert, nullptr);
    210210    data->vert_id = glCreateShader(GL_VERTEX_SHADER);
    211     glShaderSource(data->vert_id, 1, &shader, NULL);
     211    glShaderSource(data->vert_id, 1, &shader, nullptr);
    212212    glCompileShader(data->vert_id);
    213213
     
    227227    data->vert_id = cgCreateProgram(cgCreateContext(), CG_SOURCE, vert,
    228228                                    cgGLGetLatestProfile(CG_GL_VERTEX),
    229                                     NULL, NULL);
    230     if (data->vert_id == NULL)
     229                                    nullptr, nullptr);
     230    if (data->vert_id == nullptr)
    231231    {
    232232        Log::Error("failed to compile vertex shader");
     
    238238    data->frag_crc = ShaderData::hash(frag);
    239239#if defined USE_D3D9 || defined _XBOX
    240     hr = D3DXCompileShader(frag, (UINT)strlen(frag), macros, NULL, "main",
     240    hr = D3DXCompileShader(frag, (UINT)strlen(frag), macros, nullptr, "main",
    241241                           "ps_3_0", 0, &shader_code, &error_msg,
    242242                           &data->frag_table);
     
    251251    shader_code->Release();
    252252#elif !defined __CELLOS_LV2__
    253     ShaderData::Patch(buf, NULL, frag);
     253    ShaderData::Patch(buf, nullptr, frag);
    254254    data->frag_id = glCreateShader(GL_FRAGMENT_SHADER);
    255     glShaderSource(data->frag_id, 1, &shader, NULL);
     255    glShaderSource(data->frag_id, 1, &shader, nullptr);
    256256    glCompileShader(data->frag_id);
    257257
     
    271271    data->frag_id = cgCreateProgram(cgCreateContext(), CG_SOURCE, frag,
    272272                                    cgGLGetLatestProfile(CG_GL_FRAGMENT),
    273                                     NULL, NULL);
    274     if (data->frag_id == NULL)
     273                                    nullptr, nullptr);
     274    if (data->frag_id == nullptr)
    275275    {
    276276        Log::Error("failed to compile fragment shader");
     
    287287        D3DXCONSTANT_DESC cdesc;
    288288        UINT count = 1;
    289         D3DXHANDLE h = data->frag_table->GetConstant(NULL, i);
     289        D3DXHANDLE h = data->frag_table->GetConstant(nullptr, i);
    290290        data->frag_table->GetConstantDesc(h, &cdesc, &count);
    291291    }
     
    295295        D3DXCONSTANT_DESC cdesc;
    296296        UINT count = 1;
    297         D3DXHANDLE h = data->vert_table->GetConstant(NULL, i);
     297        D3DXHANDLE h = data->vert_table->GetConstant(nullptr, i);
    298298        data->frag_table->GetConstantDesc(h, &cdesc, &count);
    299299    }
     
    352352
    353353    count = 0;
    354     hr = data->frag_table->GetConstantByName(NULL, tmpname);
     354    hr = data->frag_table->GetConstantByName(nullptr, tmpname);
    355355    if (hr)
    356356        data->frag_table->GetConstantDesc(hr, &cdesc, &count);
     
    362362
    363363    count = 0;
    364     hr = data->vert_table->GetConstantByName(NULL, tmpname);
     364    hr = data->vert_table->GetConstantByName(nullptr, tmpname);
    365365    if (hr)
    366366        data->vert_table->GetConstantDesc(hr, &cdesc, &count);
     
    676676#if defined USE_D3D9 || defined _XBOX
    677677    HRESULT hr;
    678     hr = g_d3ddevice->SetVertexShader(NULL);
    679     hr = g_d3ddevice->SetPixelShader(NULL);
     678    hr = g_d3ddevice->SetVertexShader(nullptr);
     679    hr = g_d3ddevice->SetPixelShader(nullptr);
    680680#elif !defined __CELLOS_LV2__
    681681    /* FIXME: untested */
     
    729729            "#version 130\n"
    730730            "void main() { gl_Position = vec4(0.0, 0.0, 0.0, 0.0); }";
    731         glShaderSource(id, 1, &test130, NULL);
     731        glShaderSource(id, 1, &test130, nullptr);
    732732        glCompileShader(id);
    733733        glGetShaderInfoLog(id, sizeof(buf), &len, buf);
     
    741741                "#version 120\n"
    742742                "void main() { gl_Position = vec4(0.0, 0.0, 0.0, 0.0); }";
    743             glShaderSource(id, 1, &test120, NULL);
     743            glShaderSource(id, 1, &test120, nullptr);
    744744            glCompileShader(id);
    745745            glGetShaderInfoLog(id, sizeof(buf), &len, buf);
     
    836836#endif
    837837
    838             NULL
     838            nullptr
    839839        };
    840840
     
    866866            "out vec4", "varying vec4",
    867867            "out mat4", "varying mat4",
    868             NULL
     868            nullptr
    869869        };
    870870
  • trunk/src/gpu/texture.cpp

    r2315 r2506  
    116116    g_d3ddevice->CreateTexture(m_data->m_size.x, m_data->m_size.y, 1,
    117117                               d3d_usage, d3d_format,
    118                                D3DPOOL_DEFAULT, &m_data->m_texture, NULL);
     118                               D3DPOOL_DEFAULT, &m_data->m_texture, nullptr);
    119119    m_data->m_bytes_per_elem = GET_CLAMPED(d3d_formats, format).bytes;
    120120#else
     
    197197    D3DLOCKED_RECT rect;
    198198#   if defined USE_D3D9
    199     m_data->m_texture->LockRect(0, &rect, NULL, D3DLOCK_DISCARD);
    200 #   else
    201     m_data->m_texture->LockRect(0, &rect, NULL, 0);
     199    m_data->m_texture->LockRect(0, &rect, nullptr, D3DLOCK_DISCARD);
     200#   else
     201    m_data->m_texture->LockRect(0, &rect, nullptr, 0);
    202202#   endif
    203203
     
    217217#if defined _XBOX || defined USE_D3D9
    218218    D3DLOCKED_RECT rect;
    219     m_data->m_texture->LockRect(0, &rect, NULL, 0);
     219    m_data->m_texture->LockRect(0, &rect, nullptr, 0);
    220220
    221221    int stride = size.x * m_data->m_bytes_per_elem;
  • trunk/src/gpu/vertexbuffer.cpp

    r2497 r2506  
    613613        return;
    614614#if defined USE_D3D9 || defined _XBOX
    615     if (FAILED(g_d3ddevice->CreateVertexBuffer(size, D3DUSAGE_WRITEONLY, NULL,
    616                                                D3DPOOL_MANAGED, &m_data->m_vbo, NULL)))
     615    if (FAILED(g_d3ddevice->CreateVertexBuffer(size, D3DUSAGE_WRITEONLY, nullptr,
     616                                               D3DPOOL_MANAGED, &m_data->m_vbo, nullptr)))
    617617        Abort();
    618618#else
     
    640640{
    641641    if (!m_data->m_size)
    642         return NULL;
     642        return nullptr;
    643643#if defined USE_D3D9 || defined _XBOX
    644644    void *ret;
  • trunk/src/gradient.cpp

    r2476 r2506  
    4949    m_bbox[1] = bb;
    5050
    51     data->shader = NULL;
     51    data->shader = nullptr;
    5252}
    5353
  • trunk/src/image/codec/android-image.cpp

    r2183 r2506  
    5656        Log::Error("JVM environment not found, trying to attach thread\n");
    5757#endif
    58         res = g_vm->AttachCurrentThread(&env, NULL);
     58        res = g_vm->AttachCurrentThread(&env, nullptr);
    5959    }
    6060    if (res < 0)
  • trunk/src/image/codec/gdiplus-image.cpp

    r2381 r2506  
    5454    ULONG_PTR token;
    5555    Gdiplus::GdiplusStartupInput input;
    56     status = Gdiplus::GdiplusStartup(&token, &input, NULL);
     56    status = Gdiplus::GdiplusStartup(&token, &input, nullptr);
    5757    if (status != Gdiplus::Ok)
    5858    {
     
    6464
    6565    Array<String> pathlist = System::GetPathList(path);
    66     m_bitmap = NULL;
     66    m_bitmap = nullptr;
    6767    for (int i = 0; i < pathlist.Count(); ++i)
    6868    {
    6969        size_t len;
    70         len = mbstowcs(NULL, pathlist[i].C(), 0);
     70        len = mbstowcs(nullptr, pathlist[i].C(), 0);
    7171        wchar_t *wpath = new wchar_t[len + 1];
    7272        if (mbstowcs(wpath, pathlist[i].C(), len + 1) == (size_t)-1)
     
    9393#endif
    9494                delete m_bitmap;
    95                 m_bitmap = NULL;
     95                m_bitmap = nullptr;
    9696            }
    9797        }
  • trunk/src/image/codec/ps3-image.cpp

    r2382 r2506  
    7878    in_param.spuThreadPriority = 200;
    7979    in_param.cbCtrlMallocFunc = Ps3ImageData::Malloc;
    80     in_param.cbCtrlMallocArg = NULL;
     80    in_param.cbCtrlMallocArg = nullptr;
    8181    in_param.cbCtrlFreeFunc = Ps3ImageData::Free;
    82     in_param.cbCtrlFreeArg = NULL;
     82    in_param.cbCtrlFreeArg = nullptr;
    8383    CellPngDecThreadOutParam out_param;
    8484    err = cellPngDecCreate(&hmain, &in_param, &out_param);
     
    9696    dec_src.fileOffset = 0;
    9797    dec_src.fileSize = 0;
    98     dec_src.streamPtr = NULL;
     98    dec_src.streamPtr = nullptr;
    9999    dec_src.streamSize = 0;
    100100    dec_src.spuThreadEnable  = CELL_PNGDEC_SPU_THREAD_ENABLE;
     
    130130
    131131    CellPngDecInParam in_dec_param;
    132     in_dec_param.commandPtr = NULL;
     132    in_dec_param.commandPtr = nullptr;
    133133    in_dec_param.outputMode = CELL_PNGDEC_TOP_TO_BOTTOM;
    134134    in_dec_param.outputColorSpace = CELL_PNGDEC_RGBA;
  • trunk/src/image/codec/sdl-image.cpp

    r2381 r2506  
    7979    {
    8080        SDL_Surface *tmp = Create32BppSurface(size);
    81         SDL_BlitSurface(m_img, NULL, tmp, NULL);
     81        SDL_BlitSurface(m_img, nullptr, tmp, nullptr);
    8282        SDL_FreeSurface(m_img);
    8383        m_img = tmp;
  • trunk/src/image/image-private.h

    r2183 r2506  
    4040    static ImageData *Load(char const *path)
    4141    {
    42         ImageLoader *parser = Helper(NULL);
    43         ImageData *ret = NULL;
     42        ImageLoader *parser = Helper(nullptr);
     43        ImageData *ret = nullptr;
    4444
    4545        while (parser && !ret)
     
    5454    static ImageLoader *Helper(ImageLoader *set)
    5555    {
    56         static ImageLoader *loaders = NULL;
     56        static ImageLoader *loaders = nullptr;
    5757
    5858        if (!set)
     
    6565        *parser = set;
    6666
    67         return NULL;
     67        return nullptr;
    6868    }
    6969};
     
    107107            { \
    108108                delete ret; \
    109                 return NULL; \
     109                return nullptr; \
    110110            } \
    111111            return ret; \
  • trunk/src/input/input.cpp

    r2300 r2506  
    3232 */
    3333
    34 InputTracker* Input::m_input_tracker = NULL;
     34InputTracker* Input::m_input_tracker = nullptr;
    3535
    3636static class InputData
     
    117117#if defined USE_SDL
    118118#   if SDL_VERSION_ATLEAST(1,3,0)
    119     Uint8 *keystate = SDL_GetKeyboardState(NULL);
     119    Uint8 *keystate = SDL_GetKeyboardState(nullptr);
    120120#   else
    121     Uint8 *keystate = SDL_GetKeyState(NULL);
     121    Uint8 *keystate = SDL_GetKeyState(nullptr);
    122122#   endif
    123123    //SOOOoooo ugly.
     
    271271    /* Simulate a joystick using the keyboard. This SDL call is free. */
    272272#   if SDL_VERSION_ATLEAST(1,3,0)
    273     Uint8 *keystate = SDL_GetKeyboardState(NULL);
     273    Uint8 *keystate = SDL_GetKeyboardState(nullptr);
    274274#   else
    275     Uint8 *keystate = SDL_GetKeyState(NULL);
     275    Uint8 *keystate = SDL_GetKeyState(nullptr);
    276276#   endif
    277277    int left = keystate[SDLK_d] - (keystate[SDLK_a] | keystate[SDLK_q]);
     
    304304#if defined USE_SDL
    305305#   if SDL_VERSION_ATLEAST(1,3,0)
    306     Uint8 *keystate = SDL_GetKeyboardState(NULL);
     306    Uint8 *keystate = SDL_GetKeyboardState(nullptr);
    307307#   else
    308     Uint8 *keystate = SDL_GetKeyState(NULL);
     308    Uint8 *keystate = SDL_GetKeyState(nullptr);
    309309#   endif
    310310    return keystate[button];
     
    402402    data->mouse = coord;
    403403
    404     WorldEntity *top = NULL;
     404    WorldEntity *top = nullptr;
    405405
    406406    /* Find the top “widget” amongst all entities that match the
     
    487487    /* FIXME: add the possibility to choose amongst sticks */
    488488    if (desired >= data->m_sticks.Count())
    489         return NULL;
     489        return nullptr;
    490490    Ticker::Ref(data->m_sticks[desired]);
    491491    return data->m_sticks[desired];
  • trunk/src/lol/base/assert.h

    r2479 r2506  
    2020{
    2121#if defined __CELLOS_LV2__
    22     *(uint32_t *)NULL = 0xdead;
     22    *(uint32_t *)nullptr = 0xdead;
    2323#else
    2424    std::abort();
  • trunk/src/lol/gpu/vertexbuffer.h

    r2497 r2506  
    121121    template<typename T> inline void AddStream(int n, VertexUsage usage)
    122122    {
    123         m_streams[n].stream_type = GetType((T *)NULL);
     123        m_streams[n].stream_type = GetType((T *)nullptr);
    124124        m_streams[n].usage = usage;
    125125        m_streams[n].size = sizeof(T);
  • trunk/src/lol/math/remez.h

    r2394 r2506  
    7575    inline void Run(T a, T b, RealFunc *func, int decimals)
    7676    {
    77         Run(a, b, func, NULL, decimals);
     77        Run(a, b, func, nullptr, decimals);
    7878    }
    7979
  • trunk/src/map.cpp

    r2216 r2506  
    5757    char tmp[BUFSIZ];
    5858    int gids[LevelMapData::MAX_TILESETS];
    59     uint32_t *tiles = NULL;
     59    uint32_t *tiles = nullptr;
    6060    int level = 0, orientation = 0, ntiles = 0;
    6161
     
    119119                                     level, orientation, tiles);
    120120                data->m_layers.Push(l);
    121                 tiles = NULL;
     121                tiles = nullptr;
    122122                //Log::Debug("new layer %ix%i\n", data->width, data->height);
    123123            }
  • trunk/src/platform/android/androidapp.cpp

    r2297 r2506  
    7070{
    7171    int argc = 1;
    72     char *argv[] = { "", NULL };
    73     char *env[] = { NULL };
     72    char *argv[] = { "", nullptr };
     73    char *env[] = { nullptr };
    7474
    7575    /* Call the user's main() function. One of these will work. */
     
    7878    lol_android_main(argc, argv, env);
    7979
    80     return NULL;
     80    return nullptr;
    8181}
    8282
     
    108108    /* Initialise app thread and wait for it to be ready, ie. set
    109109     * the FPS value at least. */
    110     g_main_thread = new Thread(lol::AndroidApp::MainRun, NULL);;
     110    g_main_thread = new Thread(lol::AndroidApp::MainRun, nullptr);
    111111    g_main_queue.Pop();
    112112
  • trunk/src/platform/nacl/nacl-instance.cpp

    r1440 r2506  
    9292    /* Ensure only one NaClInstance does Init() at the same time. */
    9393    main_mutex.Lock();
    94     char *env[] = { NULL };
     94    char *env[] = { nullptr };
    9595    Args arglist(argc, const_cast<char **>(argv), const_cast<char **>(env));
    9696    main_queue.Push(&arglist);
    97     m_main_thread = new Thread(MainRun, NULL);
     97    m_main_thread = new Thread(MainRun, nullptr);
    9898    /* Push so that only MainSignal() can unblock us */
    99     main_queue.Push(NULL);
    100     main_queue.Push(NULL);
     99    main_queue.Push(nullptr);
     100    main_queue.Push(nullptr);
    101101    main_mutex.Unlock();
    102102
     
    121121    lol_nacl_main(arglist->m_argc, arglist->m_argv, arglist->m_env);
    122122
    123     return NULL;
     123    return nullptr;
    124124}
    125125
     
    146146    m_size = ivec2(position.size().width(), position.size().height());
    147147
    148     if (m_opengl_ctx == NULL)
     148    if (m_opengl_ctx == nullptr)
    149149        m_opengl_ctx.reset(new OpenGLContext(this));
    150150    m_opengl_ctx->InvalidateContext(this);
     
    178178void NaClInstance::DrawSelf()
    179179{
    180     if (m_opengl_ctx == NULL)
     180    if (m_opengl_ctx == nullptr)
    181181        return;
    182182
  • trunk/src/platform/nacl/opengl_context.cpp

    r1084 r2506  
    3939}
    4040
    41 bool OpenGLContext::MakeContextCurrent(pp::Instance* instance) {
    42   if (instance == NULL) {
     41bool OpenGLContext::MakeContextCurrent(pp::Instance* instance)
     42{
     43  if (instance == nullptr)
     44  {
    4345    glSetCurrentContextPPAPI(0);
    4446    return false;
  • trunk/src/platform/ps3/ps3app.cpp

    r2316 r2506  
    6464    cellSysmoduleLoadModule(CELL_SYSMODULE_IO);
    6565
    66     cellSysutilRegisterCallback(0, Ps3AppData::SysCallBack, NULL);
     66    cellSysutilRegisterCallback(0, Ps3AppData::SysCallBack, nullptr);
    6767
    6868    PSGLinitOptions psglio;
  • trunk/src/platform/ps3/threadbase.h

    r2183 r2506  
    137137    virtual ~ThreadBase()
    138138    {
    139         sys_ppu_thread_join(m_thread, NULL);
     139        sys_ppu_thread_join(m_thread, nullptr);
    140140    }
    141141
  • trunk/src/platform/sdl/sdlapp.cpp

    r2301 r2506  
    3434
    3535#if defined USE_SDL && defined USE_D3D9
    36 HWND g_hwnd = NULL;
     36HWND g_hwnd = nullptr;
    3737extern IDirect3DDevice9 *g_d3ddevice;
    3838#endif
     
    8888    }
    8989
    90     SDL_WM_SetCaption(title, NULL);
     90    SDL_WM_SetCaption(title, nullptr);
    9191
    9292    /* Initialise everything */
     
    127127    if (FAILED(hr))
    128128        Abort();
    129     hr = g_d3ddevice->Present(NULL, NULL, NULL, NULL);
     129    hr = g_d3ddevice->Present(nullptr, nullptr, nullptr, nullptr);
    130130    if (FAILED(hr))
    131131        Abort();
  • trunk/src/platform/sdl/sdlinput.cpp

    r2216 r2506  
    197197    /* Send the whole keyboard state to the input system */
    198198#if 0
    199     Uint8 *keystate = SDL_GetKeyState(NULL);
     199    Uint8 *keystate = SDL_GetKeyState(nullptr);
    200200    for (int i = 0; i < 256; i++)
    201201        if (keystate[i])
  • trunk/src/platform/xbox/xboxapp.cpp

    r2222 r2506  
    6868
    6969#if defined _XBOX
    70     g_d3ddevice->Present(NULL, NULL, NULL, NULL);
     70    g_d3ddevice->Present(nullptr, nullptr, nullptr, nullptr);
    7171#endif
    7272}
  • trunk/src/scene.cpp

    r2500 r2506  
    7676};
    7777
    78 Scene *SceneData::scene = NULL;
     78Scene *SceneData::scene = nullptr;
    7979
    8080/*
  • trunk/src/sys/file.cpp

    r2363 r2506  
    5757        if (m_fd)
    5858            fclose(m_fd);
    59         m_fd = NULL;
     59        m_fd = nullptr;
    6060#endif
    6161    }
  • trunk/src/sys/init.cpp

    r2403 r2506  
    5050
    5151#if defined HAVE_GETCWD
    52     char *cwd = getcwd(NULL, 0);
     52    char *cwd = getcwd(nullptr, 0);
    5353#elif defined HAVE__GETCWD || (defined _WIN32 && !defined _XBOX)
    54     char *cwd = _getcwd(NULL, 0);
     54    char *cwd = _getcwd(nullptr, 0);
    5555#else
    56     char *cwd = NULL;
     56    char *cwd = nullptr;
    5757#endif
    5858    String binarydir = String(cwd ? cwd : ".") + SEPARATOR;
  • trunk/src/sys/threadbase.h

    r2238 r2506  
    4040    {
    4141#if defined HAVE_PTHREAD_H
    42         pthread_mutex_init(&m_mutex, NULL);
     42        pthread_mutex_init(&m_mutex, nullptr);
    4343#elif defined _WIN32
    4444        InitializeCriticalSection(&m_mutex);
     
    8989#if defined HAVE_PTHREAD_H
    9090        m_poppers = m_pushers = 0;
    91         pthread_mutex_init(&m_mutex, NULL);
    92         pthread_cond_init(&m_empty_cond, NULL);
    93         pthread_cond_init(&m_full_cond, NULL);
    94 #elif defined _WIN32
    95         m_empty_sem = CreateSemaphore(NULL, CAPACITY, CAPACITY, NULL);
    96         m_full_sem = CreateSemaphore(NULL, 0, CAPACITY, NULL);
     91        pthread_mutex_init(&m_mutex, nullptr);
     92        pthread_cond_init(&m_empty_cond, nullptr);
     93        pthread_cond_init(&m_full_cond, nullptr);
     94#elif defined _WIN32
     95        m_empty_sem = CreateSemaphore(nullptr, CAPACITY, CAPACITY, nullptr);
     96        m_full_sem = CreateSemaphore(nullptr, 0, CAPACITY, nullptr);
    9797        InitializeCriticalSection(&m_mutex);
    9898#endif
     
    137137#elif defined _WIN32
    138138        LeaveCriticalSection(&m_mutex);
    139         ReleaseSemaphore(m_full_sem, 1, NULL);
     139        ReleaseSemaphore(m_full_sem, 1, nullptr);
    140140#endif
    141141    }
     
    169169#else
    170170        LeaveCriticalSection(&m_mutex);
    171         ReleaseSemaphore(m_empty_sem, 1, NULL);
     171        ReleaseSemaphore(m_empty_sem, 1, nullptr);
    172172#endif
    173173
     
    201201        pthread_create(&m_thread, &attr, fn, data);
    202202#elif defined _WIN32
    203         m_thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)fn,
     203        m_thread = CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)fn,
    204204                                data, 0, &m_tid);
    205205#endif
     
    209209    {
    210210#if defined HAVE_PTHREAD_H
    211         pthread_join(m_thread, NULL);
     211        pthread_join(m_thread, nullptr);
    212212#elif defined _WIN32
    213213        WaitForSingleObject(m_thread, INFINITE);
  • trunk/src/sys/timer.cpp

    r2429 r2506  
    6060    {
    6161        struct timeval tv, tv0 = m_tv;
    62         gettimeofday(&tv, NULL);
     62        gettimeofday(&tv, nullptr);
    6363        if (reset)
    6464            m_tv = tv;
  • trunk/src/text.cpp

    r2377 r2506  
    4646{
    4747    data->font = Forge::Register(font);
    48     data->text = text ? strdup(text) : NULL;
     48    data->text = text ? strdup(text) : nullptr;
    4949    data->length = text ? strlen(text) : 0;
    5050    data->pos = vec3(0, 0, 0);
     
    5757    if (data->text)
    5858        free(data->text);
    59     data->text = text ? strdup(text) : NULL;
     59    data->text = text ? strdup(text) : nullptr;
    6060    data->length = text ? strlen(text) : 0;
    6161}
  • trunk/src/ticker.cpp

    r2444 r2506  
    4040    {
    4141        for (int i = 0; i < Entity::ALLGROUP_END; i++)
    42             list[i] = NULL;
     42            list[i] = nullptr;
    4343    }
    4444
     
    115115void Ticker::Ref(Entity *entity)
    116116{
    117     ASSERT(entity, "dereferencing NULL entity\n");
     117    ASSERT(entity, "dereferencing nullptr entity\n");
    118118    ASSERT(!entity->m_destroy,
    119119           "referencing entity scheduled for destruction %s\n",
     
    125125         * very fast since the first entry in autolist is the last
    126126         * registered entity. */
    127         for (Entity *e = data->autolist, *prev = NULL; e;
     127        for (Entity *e = data->autolist, *prev = nullptr; e;
    128128             prev = e, e = e->m_autonext)
    129129        {
     
    142142int Ticker::Unref(Entity *entity)
    143143{
    144     ASSERT(entity, "dereferencing NULL entity\n");
     144    ASSERT(entity, "dereferencing null entity\n");
    145145    ASSERT(entity->m_ref > 0, "dereferencing unreferenced entity %s\n",
    146146           entity->GetName())
     
    248248         * inthe tick lists can be marked for destruction. */
    249249        for (int i = 0; i < Entity::ALLGROUP_END; i++)
    250             for (Entity *e = data->list[i], *prev = NULL; e; )
     250            for (Entity *e = data->list[i], *prev = nullptr; e; )
    251251            {
    252252                if (e->m_destroy && i < Entity::GAMEGROUP_END)
     
    322322#endif
    323323
    324     return NULL;
     324    return nullptr;
    325325}
    326326
     
    336336    }
    337337
    338     return NULL;
     338    return nullptr;
    339339}
    340340
     
    344344    data->disktick.Pop();
    345345
    346     return NULL;
     346    return nullptr;
    347347}
    348348
     
    362362    data->fps = fps;
    363363
    364     data->gamethread = new Thread(TickerData::GameThreadMain, NULL);
     364    data->gamethread = new Thread(TickerData::GameThreadMain, nullptr);
    365365    data->gametick.Push(1);
    366366
    367     data->diskthread = new Thread(TickerData::DiskThreadMain, NULL);
     367    data->diskthread = new Thread(TickerData::DiskThreadMain, nullptr);
    368368}
    369369
  • trunk/src/tileset.cpp

    r2439 r2506  
    7171    sprintf(data->name, "<tileset> %s", path);
    7272
    73     data->tiles = NULL;
     73    data->tiles = nullptr;
    7474    data->m_texture = 0;
    7575    data->img = new Image(path);
     
    154154            free(pixels);
    155155        delete data->img;
    156         data->img = NULL;
     156        data->img = nullptr;
    157157    }
    158158}
  • trunk/src/video.cpp

    r2480 r2506  
    308308    if (m & ClearMask::Stencil)
    309309        mask |= D3DCLEAR_STENCIL;
    310     if (FAILED(VideoData::d3d_dev->Clear(0, NULL, mask,
     310    if (FAILED(VideoData::d3d_dev->Clear(0, nullptr, mask,
    311311                                         VideoData::clear_color,
    312312                                         VideoData::clear_depth, 0)))
  • trunk/tools/vimlol/vimlol.vim

    r2181 r2506  
    4040   \ float2 float3 float4 float2x2 float3x3 float4x4
    4141
     42" Ensure we know about nullptr
     43au Syntax cpp
     44   \ syn keyword cConstant
     45   \ nullptr
     46
    4247
    4348"""
Note: See TracChangeset for help on using the changeset viewer.