Changeset 2506
- Timestamp:
- Feb 26, 2013, 2:43:45 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 50 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/base/string.cpp
r2256 r2506 60 60 /* vsnprintf() tells us how many character we need, and we need to 61 61 * 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; 63 63 64 64 ((Super &)ret).Reserve(needed); -
trunk/src/core.h
r2500 r2506 45 45 # define FP_USE(x) (void)(x) 46 46 #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 47 59 48 60 /* Ensure isnan() is present even on systems that don't define it, or -
trunk/src/debug/fps.cpp
r2403 r2506 45 45 for (int i = 0; i < 5; i ++) 46 46 { 47 data->lines[i] = new Text( NULL, "data/font/ascii.png");47 data->lines[i] = new Text(nullptr, "data/font/ascii.png"); 48 48 data->lines[i]->SetPos(ivec3(x, y + (i ? 8 : 0) + 16 * i, 0)); 49 49 Ticker::Ref(data->lines[i]); 50 50 } 51 51 #else 52 data->lines[0] = new Text( NULL, "data/font/ascii.png");52 data->lines[0] = new Text(nullptr, "data/font/ascii.png"); 53 53 data->lines[0]->SetPos(ivec3(x, y, 100)); 54 54 Ticker::Ref(data->lines[0]); -
trunk/src/debug/record.cpp
r2216 r2506 57 57 data->fps = (int)(fps + 0.5f); 58 58 #if defined USE_PIPI 59 data->sequence = NULL;59 data->sequence = nullptr; 60 60 #endif 61 61 -
trunk/src/dict.cpp
r2216 r2506 107 107 { 108 108 empty = data->m_entities.Count(); 109 data->m_entities.Push( NULL);109 data->m_entities.Push(nullptr); 110 110 } 111 111 112 data->m_entities[empty] = NULL;112 data->m_entities[empty] = nullptr; 113 113 slotid = empty; 114 114 data->nentities++; … … 126 126 if (Ticker::Unref(data->m_entities[slotid]) == 0) 127 127 { 128 data->m_entities[slotid] = NULL;128 data->m_entities[slotid] = nullptr; 129 129 data->nentities--; 130 130 } -
trunk/src/easymesh/easymesh-scanner.l
r2410 r2506 111 111 112 112 #[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); 114 114 yylval->u32val = 0x11000000u * (tmp >> 8) 115 115 | 0x00110000u * ((tmp >> 4) & 0xf) … … 118 118 return token::COLOR; } 119 119 #[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); 121 121 yylval->u32val = 0x11000000u * (tmp >> 12) 122 122 | 0x00110000u * ((tmp >> 8) & 0xf) … … 126 126 #[0-9a-fA-F]{6} { 127 127 yylval->u32val = 0xffu 128 | 0x100u * (uint32_t)std::strtol(yytext + 1, NULL, 16);128 | 0x100u * (uint32_t)std::strtol(yytext + 1, nullptr, 16); 129 129 return token::COLOR; } 130 130 #[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); 132 132 return token::COLOR; } 133 133 [-+]?[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)? { -
trunk/src/easymesh/easymesh.cpp
r2480 r2506 86 86 if (m_shader_uniform[i].m1 == uniform) 87 87 return &m_shader_uniform[i].m2; 88 return NULL;88 return nullptr; 89 89 } 90 90 … … 95 95 if (m_shader_attrib[i].m1 == attribute) 96 96 return &m_shader_attrib[i].m2; 97 return NULL;97 return nullptr; 98 98 } 99 99 … … 182 182 m_vertexcount = 0; 183 183 m_indexcount = 0; 184 m_ibo = NULL;184 m_ibo = nullptr; 185 185 } 186 186 … … 221 221 m_gpudatas.Reserve(DebugRenderMode::Max); 222 222 for (int i = 0; i < DebugRenderMode::Max; i++) 223 m_gpudatas << NULL;223 m_gpudatas << nullptr; 224 224 } 225 225 m_gpudatas[gpudata->m_render_mode] = gpudata; … … 233 233 return; 234 234 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; 238 238 int vbo_bytes = 0; 239 239 … … 365 365 //----------------------------------------------------------------------------- 366 366 EasyMesh::EasyMesh() 367 : m_build_data( NULL)367 : m_build_data(nullptr) 368 368 { 369 369 m_cursors.Push(0, 0); … … 392 392 { 393 393 delete(m_build_data); 394 m_build_data = NULL;394 m_build_data = nullptr; 395 395 396 396 if (new_gpu_sdata) … … 2251 2251 2252 2252 //----------------------------------------------------------------------------- 2253 void EasyMesh::SplitTriangles(int pass) { SplitTriangles(pass, NULL); }2253 void EasyMesh::SplitTriangles(int pass) { SplitTriangles(pass, nullptr); } 2254 2254 2255 2255 //----------------------------------------------------------------------------- -
trunk/src/easymesh/easymesh.h
r2480 r2506 488 488 int FindVertexMaster(const int search_idx); 489 489 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); 494 494 void AddVertex(int vert_id, vec3 vert_coord); 495 495 bool GetMasterList(Array<int> &ret_master_list) { ret_master_list = master_list; return ret_master_list.Count() > 0; } … … 525 525 bool Compile(char const *command); 526 526 void MeshConvert(GpuShaderData* new_gpu_sdata); 527 void MeshConvert(Shader* ProvidedShader = NULL);527 void MeshConvert(Shader* ProvidedShader = nullptr); 528 528 void Render(mat4 const &model); 529 529 -
trunk/src/eglapp.cpp
r2301 r2506 79 79 data->egl_dpy = eglGetDisplay(EGL_DEFAULT_DISPLAY); 80 80 # else 81 data->dpy = XOpenDisplay( NULL);82 if (data->dpy == NULL)81 data->dpy = XOpenDisplay(nullptr); 82 if (data->dpy == nullptr) 83 83 { 84 84 Log::Error("cannot connect to X server\n"); … … 116 116 } 117 117 118 if (!eglInitialize(data->egl_dpy, NULL, NULL))118 if (!eglInitialize(data->egl_dpy, nullptr, nullptr)) 119 119 { 120 120 Log::Error("cannot initialize EGL\n"); … … 188 188 189 189 data->egl_surf = eglCreateWindowSurface(data->egl_dpy, ecfg, 190 &data->nativewindow, NULL);190 &data->nativewindow, nullptr); 191 191 # else 192 192 data->egl_surf = eglCreateWindowSurface(data->egl_dpy, ecfg, 193 193 (EGLNativeWindowType)data->win, 194 NULL);194 nullptr); 195 195 # endif 196 196 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. */ 2 2 3 3 /* Skeleton implementation for Bison LALR(1) parsers in C++ 4 4 5 Copyright (C) 2002-201 0Free Software Foundation, Inc.5 Copyright (C) 2002-2011 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 36 36 /* First part of user declarations. */ 37 37 38 /* Line 310of lalr1.cc */38 /* Line 293 of lalr1.cc */ 39 39 #line 1 "easymesh/easymesh-parser.y" 40 40 … … 62 62 63 63 64 /* Line 310of lalr1.cc */64 /* Line 293 of lalr1.cc */ 65 65 #line 66 "generated/easymesh-parser.cpp" 66 66 … … 70 70 /* User implementation prologue. */ 71 71 72 /* Line 316of lalr1.cc */72 /* Line 299 of lalr1.cc */ 73 73 #line 66 "easymesh/easymesh-parser.y" 74 74 … … 79 79 80 80 81 /* Line 316of lalr1.cc */81 /* Line 299 of lalr1.cc */ 82 82 #line 83 "generated/easymesh-parser.cpp" 83 83 … … 94 94 #endif 95 95 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 96 116 /* Suppress unused-variable warnings by "using" E. */ 97 117 #define YYUSE(e) ((void) (e)) … … 145 165 namespace lol { 146 166 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" 150 169 151 170 /* Return YYSTR after stripping away unnecessary quotes and … … 186 205 } 187 206 188 #endif189 207 190 208 /// Build a parser object. … … 287 305 #endif 288 306 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 289 319 int 290 320 EasyMeshParser::parse () … … 308 338 location_type yylloc; 309 339 /// The locations where the error started and ended. 310 location_type yyerror_range[ 2];340 location_type yyerror_range[3]; 311 341 312 342 /// $$. … … 346 376 /* Try to take a decision without lookahead. */ 347 377 yyn = yypact_[yystate]; 348 if (yy n == yypact_ninf_)378 if (yy_pact_value_is_default_ (yyn)) 349 379 goto yydefault; 350 380 … … 379 409 if (yyn <= 0) 380 410 { 381 if (yy n == 0 || yyn == yytable_ninf_)382 goto yyerrlab;411 if (yy_table_value_is_error_ (yyn)) 412 goto yyerrlab; 383 413 yyn = -yyn; 384 414 goto yyreduce; … … 436 466 case 7: 437 467 438 /* Line 6 77of lalr1.cc */468 /* Line 690 of lalr1.cc */ 439 469 #line 90 "easymesh/easymesh-parser.y" 440 470 { mc.m_mesh.OpenBrace(); } … … 443 473 case 8: 444 474 445 /* Line 6 77of lalr1.cc */475 /* Line 690 of lalr1.cc */ 446 476 #line 94 "easymesh/easymesh-parser.y" 447 477 { mc.m_mesh.CloseBrace(); } … … 450 480 case 14: 451 481 452 /* Line 6 77of lalr1.cc */482 /* Line 690 of lalr1.cc */ 453 483 #line 109 "easymesh/easymesh-parser.y" 454 484 { 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)); } … … 457 487 case 15: 458 488 459 /* Line 6 77of lalr1.cc */489 /* Line 690 of lalr1.cc */ 460 490 #line 110 "easymesh/easymesh-parser.y" 461 491 { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val); … … 466 496 case 16: 467 497 468 /* Line 6 77of lalr1.cc */498 /* Line 690 of lalr1.cc */ 469 499 #line 113 "easymesh/easymesh-parser.y" 470 500 { 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)); } … … 473 503 case 17: 474 504 475 /* Line 6 77of lalr1.cc */505 /* Line 690 of lalr1.cc */ 476 506 #line 114 "easymesh/easymesh-parser.y" 477 507 { uint32_t x = (yysemantic_stack_[(2) - (2)].u32val); … … 482 512 case 18: 483 513 484 /* Line 6 77of lalr1.cc */514 /* Line 690 of lalr1.cc */ 485 515 #line 120 "easymesh/easymesh-parser.y" 486 516 { mc.m_mesh.Chamfer((yysemantic_stack_[(2) - (2)].args).f0); } … … 489 519 case 19: 490 520 491 /* Line 6 77of lalr1.cc */521 /* Line 690 of lalr1.cc */ 492 522 #line 121 "easymesh/easymesh-parser.y" 493 523 { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, 0, 0)); } … … 496 526 case 20: 497 527 498 /* Line 6 77of lalr1.cc */528 /* Line 690 of lalr1.cc */ 499 529 #line 122 "easymesh/easymesh-parser.y" 500 530 { mc.m_mesh.Translate(vec3(0, (yysemantic_stack_[(2) - (2)].args).f0, 0)); } … … 503 533 case 21: 504 534 505 /* Line 6 77of lalr1.cc */535 /* Line 690 of lalr1.cc */ 506 536 #line 123 "easymesh/easymesh-parser.y" 507 537 { mc.m_mesh.Translate(vec3(0, 0, (yysemantic_stack_[(2) - (2)].args).f0)); } … … 510 540 case 22: 511 541 512 /* Line 6 77of lalr1.cc */542 /* Line 690 of lalr1.cc */ 513 543 #line 124 "easymesh/easymesh-parser.y" 514 544 { mc.m_mesh.Translate(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } … … 517 547 case 23: 518 548 519 /* Line 6 77of lalr1.cc */549 /* Line 690 of lalr1.cc */ 520 550 #line 125 "easymesh/easymesh-parser.y" 521 551 { mc.m_mesh.RotateX((yysemantic_stack_[(2) - (2)].args).f0); } … … 524 554 case 24: 525 555 526 /* Line 6 77of lalr1.cc */556 /* Line 690 of lalr1.cc */ 527 557 #line 126 "easymesh/easymesh-parser.y" 528 558 { mc.m_mesh.RotateY((yysemantic_stack_[(2) - (2)].args).f0); } … … 531 561 case 25: 532 562 533 /* Line 6 77of lalr1.cc */563 /* Line 690 of lalr1.cc */ 534 564 #line 127 "easymesh/easymesh-parser.y" 535 565 { mc.m_mesh.RotateZ((yysemantic_stack_[(2) - (2)].args).f0); } … … 538 568 case 26: 539 569 540 /* Line 6 77of lalr1.cc */570 /* Line 690 of lalr1.cc */ 541 571 #line 128 "easymesh/easymesh-parser.y" 542 572 { mc.m_mesh.TaperX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } … … 545 575 case 27: 546 576 547 /* Line 6 77of lalr1.cc */577 /* Line 690 of lalr1.cc */ 548 578 #line 129 "easymesh/easymesh-parser.y" 549 579 { 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); } … … 552 582 case 28: 553 583 554 /* Line 6 77of lalr1.cc */584 /* Line 690 of lalr1.cc */ 555 585 #line 130 "easymesh/easymesh-parser.y" 556 586 { mc.m_mesh.TaperY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } … … 559 589 case 29: 560 590 561 /* Line 6 77of lalr1.cc */591 /* Line 690 of lalr1.cc */ 562 592 #line 131 "easymesh/easymesh-parser.y" 563 593 { 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); } … … 566 596 case 30: 567 597 568 /* Line 6 77of lalr1.cc */598 /* Line 690 of lalr1.cc */ 569 599 #line 132 "easymesh/easymesh-parser.y" 570 600 { mc.m_mesh.TaperZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } … … 573 603 case 31: 574 604 575 /* Line 6 77of lalr1.cc */605 /* Line 690 of lalr1.cc */ 576 606 #line 133 "easymesh/easymesh-parser.y" 577 607 { 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); } … … 580 610 case 32: 581 611 582 /* Line 6 77of lalr1.cc */612 /* Line 690 of lalr1.cc */ 583 613 #line 134 "easymesh/easymesh-parser.y" 584 614 { mc.m_mesh.TwistX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } … … 587 617 case 33: 588 618 589 /* Line 6 77of lalr1.cc */619 /* Line 690 of lalr1.cc */ 590 620 #line 135 "easymesh/easymesh-parser.y" 591 621 { mc.m_mesh.TwistY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } … … 594 624 case 34: 595 625 596 /* Line 6 77of lalr1.cc */626 /* Line 690 of lalr1.cc */ 597 627 #line 136 "easymesh/easymesh-parser.y" 598 628 { mc.m_mesh.TwistZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } … … 601 631 case 35: 602 632 603 /* Line 6 77of lalr1.cc */633 /* Line 690 of lalr1.cc */ 604 634 #line 137 "easymesh/easymesh-parser.y" 605 635 { mc.m_mesh.ShearX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } … … 608 638 case 36: 609 639 610 /* Line 6 77of lalr1.cc */640 /* Line 690 of lalr1.cc */ 611 641 #line 138 "easymesh/easymesh-parser.y" 612 642 { 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); } … … 615 645 case 37: 616 646 617 /* Line 6 77of lalr1.cc */647 /* Line 690 of lalr1.cc */ 618 648 #line 139 "easymesh/easymesh-parser.y" 619 649 { mc.m_mesh.ShearY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } … … 622 652 case 38: 623 653 624 /* Line 6 77of lalr1.cc */654 /* Line 690 of lalr1.cc */ 625 655 #line 140 "easymesh/easymesh-parser.y" 626 656 { 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); } … … 629 659 case 39: 630 660 631 /* Line 6 77of lalr1.cc */661 /* Line 690 of lalr1.cc */ 632 662 #line 141 "easymesh/easymesh-parser.y" 633 663 { mc.m_mesh.ShearZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } … … 636 666 case 40: 637 667 638 /* Line 6 77of lalr1.cc */668 /* Line 690 of lalr1.cc */ 639 669 #line 142 "easymesh/easymesh-parser.y" 640 670 { 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); } … … 643 673 case 41: 644 674 645 /* Line 6 77of lalr1.cc */675 /* Line 690 of lalr1.cc */ 646 676 #line 143 "easymesh/easymesh-parser.y" 647 677 { mc.m_mesh.StretchX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } … … 650 680 case 42: 651 681 652 /* Line 6 77of lalr1.cc */682 /* Line 690 of lalr1.cc */ 653 683 #line 144 "easymesh/easymesh-parser.y" 654 684 { mc.m_mesh.StretchY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } … … 657 687 case 43: 658 688 659 /* Line 6 77of lalr1.cc */689 /* Line 690 of lalr1.cc */ 660 690 #line 145 "easymesh/easymesh-parser.y" 661 691 { mc.m_mesh.StretchZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } … … 664 694 case 44: 665 695 666 /* Line 6 77of lalr1.cc */696 /* Line 690 of lalr1.cc */ 667 697 #line 146 "easymesh/easymesh-parser.y" 668 698 { mc.m_mesh.BendXY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } … … 671 701 case 45: 672 702 673 /* Line 6 77of lalr1.cc */703 /* Line 690 of lalr1.cc */ 674 704 #line 147 "easymesh/easymesh-parser.y" 675 705 { mc.m_mesh.BendXZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } … … 678 708 case 46: 679 709 680 /* Line 6 77of lalr1.cc */710 /* Line 690 of lalr1.cc */ 681 711 #line 148 "easymesh/easymesh-parser.y" 682 712 { mc.m_mesh.BendYX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } … … 685 715 case 47: 686 716 687 /* Line 6 77of lalr1.cc */717 /* Line 690 of lalr1.cc */ 688 718 #line 149 "easymesh/easymesh-parser.y" 689 719 { mc.m_mesh.BendYZ((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } … … 692 722 case 48: 693 723 694 /* Line 6 77of lalr1.cc */724 /* Line 690 of lalr1.cc */ 695 725 #line 150 "easymesh/easymesh-parser.y" 696 726 { mc.m_mesh.BendZX((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } … … 699 729 case 49: 700 730 701 /* Line 6 77of lalr1.cc */731 /* Line 690 of lalr1.cc */ 702 732 #line 151 "easymesh/easymesh-parser.y" 703 733 { mc.m_mesh.BendZY((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } … … 706 736 case 50: 707 737 708 /* Line 6 77of lalr1.cc */738 /* Line 690 of lalr1.cc */ 709 739 #line 152 "easymesh/easymesh-parser.y" 710 740 { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, 1.0, 1.0)); } … … 713 743 case 51: 714 744 715 /* Line 6 77of lalr1.cc */745 /* Line 690 of lalr1.cc */ 716 746 #line 153 "easymesh/easymesh-parser.y" 717 747 { mc.m_mesh.Scale(vec3(1.0, (yysemantic_stack_[(2) - (2)].args).f0, 1.0)); } … … 720 750 case 52: 721 751 722 /* Line 6 77of lalr1.cc */752 /* Line 690 of lalr1.cc */ 723 753 #line 154 "easymesh/easymesh-parser.y" 724 754 { mc.m_mesh.Scale(vec3(1.0, 1.0, (yysemantic_stack_[(2) - (2)].args).f0)); } … … 727 757 case 53: 728 758 729 /* Line 6 77of lalr1.cc */759 /* Line 690 of lalr1.cc */ 730 760 #line 155 "easymesh/easymesh-parser.y" 731 761 { mc.m_mesh.Scale(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } … … 734 764 case 54: 735 765 736 /* Line 6 77of lalr1.cc */766 /* Line 690 of lalr1.cc */ 737 767 #line 156 "easymesh/easymesh-parser.y" 738 768 { mc.m_mesh.MirrorX(); } … … 741 771 case 55: 742 772 743 /* Line 6 77of lalr1.cc */773 /* Line 690 of lalr1.cc */ 744 774 #line 157 "easymesh/easymesh-parser.y" 745 775 { mc.m_mesh.MirrorY(); } … … 748 778 case 56: 749 779 750 /* Line 6 77of lalr1.cc */780 /* Line 690 of lalr1.cc */ 751 781 #line 158 "easymesh/easymesh-parser.y" 752 782 { mc.m_mesh.MirrorZ(); } … … 755 785 case 57: 756 786 757 /* Line 6 77of lalr1.cc */787 /* Line 690 of lalr1.cc */ 758 788 #line 159 "easymesh/easymesh-parser.y" 759 789 { mc.m_mesh.RadialJitter((yysemantic_stack_[(2) - (2)].args).f0); } … … 762 792 case 58: 763 793 764 /* Line 6 77of lalr1.cc */794 /* Line 690 of lalr1.cc */ 765 795 #line 160 "easymesh/easymesh-parser.y" 766 796 { mc.m_mesh.SplitTriangles((yysemantic_stack_[(2) - (2)].args).f0); } … … 769 799 case 59: 770 800 771 /* Line 6 77of lalr1.cc */801 /* Line 690 of lalr1.cc */ 772 802 #line 161 "easymesh/easymesh-parser.y" 773 803 { mc.m_mesh.SmoothMesh((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } … … 776 806 case 60: 777 807 778 /* Line 6 77of lalr1.cc */808 /* Line 690 of lalr1.cc */ 779 809 #line 162 "easymesh/easymesh-parser.y" 780 810 { mc.m_mesh.ToggleScaleWinding(); } … … 783 813 case 61: 784 814 785 /* Line 6 77of lalr1.cc */815 /* Line 690 of lalr1.cc */ 786 816 #line 163 "easymesh/easymesh-parser.y" 787 817 { mc.m_mesh.CsgUnion(); } … … 790 820 case 62: 791 821 792 /* Line 6 77of lalr1.cc */822 /* Line 690 of lalr1.cc */ 793 823 #line 164 "easymesh/easymesh-parser.y" 794 824 { mc.m_mesh.CsgSubstract(); } … … 797 827 case 63: 798 828 799 /* Line 6 77of lalr1.cc */829 /* Line 690 of lalr1.cc */ 800 830 #line 165 "easymesh/easymesh-parser.y" 801 831 { mc.m_mesh.CsgSubstractLoss(); } … … 804 834 case 64: 805 835 806 /* Line 6 77of lalr1.cc */836 /* Line 690 of lalr1.cc */ 807 837 #line 166 "easymesh/easymesh-parser.y" 808 838 { mc.m_mesh.CsgAnd(); } … … 811 841 case 65: 812 842 813 /* Line 6 77of lalr1.cc */843 /* Line 690 of lalr1.cc */ 814 844 #line 167 "easymesh/easymesh-parser.y" 815 845 { mc.m_mesh.CsgXor(); } … … 818 848 case 66: 819 849 820 /* Line 6 77of lalr1.cc */850 /* Line 690 of lalr1.cc */ 821 851 #line 171 "easymesh/easymesh-parser.y" 822 852 { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, … … 827 857 case 67: 828 858 829 /* Line 6 77of lalr1.cc */859 /* Line 690 of lalr1.cc */ 830 860 #line 174 "easymesh/easymesh-parser.y" 831 861 { mc.m_mesh.AppendCylinder((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, … … 836 866 case 68: 837 867 838 /* Line 6 77of lalr1.cc */868 /* Line 690 of lalr1.cc */ 839 869 #line 177 "easymesh/easymesh-parser.y" 840 870 { mc.m_mesh.AppendBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2)); } … … 843 873 case 69: 844 874 845 /* Line 6 77of lalr1.cc */875 /* Line 690 of lalr1.cc */ 846 876 #line 178 "easymesh/easymesh-parser.y" 847 877 { mc.m_mesh.AppendSmoothChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, … … 851 881 case 70: 852 882 853 /* Line 6 77of lalr1.cc */883 /* Line 690 of lalr1.cc */ 854 884 #line 180 "easymesh/easymesh-parser.y" 855 885 { mc.m_mesh.AppendFlatChamfBox(vec3((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, … … 859 889 case 71: 860 890 861 /* Line 6 77of lalr1.cc */891 /* Line 690 of lalr1.cc */ 862 892 #line 182 "easymesh/easymesh-parser.y" 863 893 { mc.m_mesh.AppendSphere((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1); } … … 866 896 case 72: 867 897 868 /* Line 6 77of lalr1.cc */898 /* Line 690 of lalr1.cc */ 869 899 #line 183 "easymesh/easymesh-parser.y" 870 900 { mc.m_mesh.AppendCapsule((yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } … … 873 903 case 73: 874 904 875 /* Line 6 77of lalr1.cc */905 /* Line 690 of lalr1.cc */ 876 906 #line 184 "easymesh/easymesh-parser.y" 877 907 { mc.m_mesh.AppendTorus((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2); } … … 880 910 case 74: 881 911 882 /* Line 6 77of lalr1.cc */912 /* Line 690 of lalr1.cc */ 883 913 #line 185 "easymesh/easymesh-parser.y" 884 914 { mc.m_mesh.AppendStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (yysemantic_stack_[(2) - (2)].args).f2, … … 888 918 case 75: 889 919 890 /* Line 6 77of lalr1.cc */920 /* Line 690 of lalr1.cc */ 891 921 #line 187 "easymesh/easymesh-parser.y" 892 922 { mc.m_mesh.AppendExpandedStar((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, … … 896 926 case 76: 897 927 898 /* Line 6 77of lalr1.cc */928 /* Line 690 of lalr1.cc */ 899 929 #line 189 "easymesh/easymesh-parser.y" 900 930 { mc.m_mesh.AppendDisc((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, (int)(yysemantic_stack_[(2) - (2)].args).f2); } … … 903 933 case 77: 904 934 905 /* Line 6 77of lalr1.cc */935 /* Line 690 of lalr1.cc */ 906 936 #line 190 "easymesh/easymesh-parser.y" 907 937 { mc.m_mesh.AppendSimpleTriangle((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } … … 910 940 case 78: 911 941 912 /* Line 6 77of lalr1.cc */942 /* Line 690 of lalr1.cc */ 913 943 #line 191 "easymesh/easymesh-parser.y" 914 944 { mc.m_mesh.AppendSimpleQuad((yysemantic_stack_[(2) - (2)].args).f0, (int)(yysemantic_stack_[(2) - (2)].args).f1); } … … 917 947 case 79: 918 948 919 /* Line 6 77of lalr1.cc */949 /* Line 690 of lalr1.cc */ 920 950 #line 192 "easymesh/easymesh-parser.y" 921 951 { mc.m_mesh.AppendCog((int)(yysemantic_stack_[(2) - (2)].args).f0, (yysemantic_stack_[(2) - (2)].args).f1, … … 926 956 case 80: 927 957 928 /* Line 6 77of lalr1.cc */958 /* Line 690 of lalr1.cc */ 929 959 #line 197 "easymesh/easymesh-parser.y" 930 960 { (yyval.args).f0 = (yysemantic_stack_[(1) - (1)].fval); } … … 933 963 case 81: 934 964 935 /* Line 6 77of lalr1.cc */965 /* Line 690 of lalr1.cc */ 936 966 #line 198 "easymesh/easymesh-parser.y" 937 967 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f1 = (yysemantic_stack_[(2) - (2)].fval); } … … 940 970 case 82: 941 971 942 /* Line 6 77of lalr1.cc */972 /* Line 690 of lalr1.cc */ 943 973 #line 199 "easymesh/easymesh-parser.y" 944 974 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f2 = (yysemantic_stack_[(2) - (2)].fval); } … … 947 977 case 83: 948 978 949 /* Line 6 77of lalr1.cc */979 /* Line 690 of lalr1.cc */ 950 980 #line 200 "easymesh/easymesh-parser.y" 951 981 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f3 = (yysemantic_stack_[(2) - (2)].fval); } … … 954 984 case 84: 955 985 956 /* Line 6 77of lalr1.cc */986 /* Line 690 of lalr1.cc */ 957 987 #line 201 "easymesh/easymesh-parser.y" 958 988 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f4 = (yysemantic_stack_[(2) - (2)].fval); } … … 961 991 case 85: 962 992 963 /* Line 6 77of lalr1.cc */993 /* Line 690 of lalr1.cc */ 964 994 #line 202 "easymesh/easymesh-parser.y" 965 995 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f5 = (yysemantic_stack_[(2) - (2)].fval); } … … 968 998 case 86: 969 999 970 /* Line 6 77of lalr1.cc */1000 /* Line 690 of lalr1.cc */ 971 1001 #line 203 "easymesh/easymesh-parser.y" 972 1002 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f6 = (yysemantic_stack_[(2) - (2)].fval); } … … 975 1005 case 87: 976 1006 977 /* Line 6 77of lalr1.cc */1007 /* Line 690 of lalr1.cc */ 978 1008 #line 204 "easymesh/easymesh-parser.y" 979 1009 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f7 = (yysemantic_stack_[(2) - (2)].fval); } … … 982 1012 case 88: 983 1013 984 /* Line 6 77of lalr1.cc */1014 /* Line 690 of lalr1.cc */ 985 1015 #line 205 "easymesh/easymesh-parser.y" 986 1016 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f8 = (yysemantic_stack_[(2) - (2)].fval); } … … 989 1019 case 89: 990 1020 991 /* Line 6 77of lalr1.cc */1021 /* Line 690 of lalr1.cc */ 992 1022 #line 206 "easymesh/easymesh-parser.y" 993 1023 { (yyval.args) = (yysemantic_stack_[(2) - (1)].args); (yyval.args).f9 = (yysemantic_stack_[(2) - (2)].fval); } … … 996 1026 case 90: 997 1027 998 /* Line 6 77of lalr1.cc */1028 /* Line 690 of lalr1.cc */ 999 1029 #line 209 "easymesh/easymesh-parser.y" 1000 1030 { (yyval.fval) = (yysemantic_stack_[(1) - (1)].fval); } … … 1003 1033 case 91: 1004 1034 1005 /* Line 6 77of lalr1.cc */1035 /* Line 690 of lalr1.cc */ 1006 1036 #line 210 "easymesh/easymesh-parser.y" 1007 1037 { (yyval.fval) = -(yysemantic_stack_[(2) - (2)].fval); } … … 1010 1040 1011 1041 1012 /* Line 6 77of lalr1.cc */1013 #line 10 14 "generated/easymesh-parser.cpp"1042 /* Line 690 of lalr1.cc */ 1043 #line 1044 "generated/easymesh-parser.cpp" 1014 1044 default: 1015 1045 break; 1016 1046 } 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. */ 1017 1058 YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); 1018 1059 … … 1038 1079 `------------------------------------*/ 1039 1080 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 1040 1085 /* If not already recovering from an error, report this error. */ 1041 1086 if (!yyerrstatus_) 1042 1087 { 1043 1088 ++yynerrs_; 1089 if (yychar == yyempty_) 1090 yytoken = yyempty_; 1044 1091 error (yylloc, yysyntax_error_ (yystate, yytoken)); 1045 1092 } 1046 1093 1047 yyerror_range[ 0] = yylloc;1094 yyerror_range[1] = yylloc; 1048 1095 if (yyerrstatus_ == 3) 1049 1096 { … … 1080 1127 goto yyerrorlab; 1081 1128 1082 yyerror_range[ 0] = yylocation_stack_[yylen - 1];1129 yyerror_range[1] = yylocation_stack_[yylen - 1]; 1083 1130 /* Do not reclaim the symbols of the rule which action triggered 1084 1131 this YYERROR. */ … … 1097 1144 { 1098 1145 yyn = yypact_[yystate]; 1099 if ( yyn != yypact_ninf_)1146 if (!yy_pact_value_is_default_ (yyn)) 1100 1147 { 1101 1148 yyn += yyterror_; … … 1112 1159 YYABORT; 1113 1160 1114 yyerror_range[ 0] = yylocation_stack_[0];1161 yyerror_range[1] = yylocation_stack_[0]; 1115 1162 yydestruct_ ("Error: popping", 1116 1163 yystos_[yystate], … … 1121 1168 } 1122 1169 1123 yyerror_range[ 1] = yylloc;1170 yyerror_range[2] = yylloc; 1124 1171 // Using YYLLOC is tempting, but would change the location of 1125 1172 // the lookahead. YYLOC is available though. 1126 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);1173 YYLLOC_DEFAULT (yyloc, yyerror_range, 2); 1127 1174 yysemantic_stack_.push (yylval); 1128 1175 yylocation_stack_.push (yyloc); … … 1147 1194 yyreturn: 1148 1195 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 } 1150 1203 1151 1204 /* Do not reclaim the symbols of the rule which action triggered … … 1166 1219 // Generate an error message. 1167 1220 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_) 1175 1258 { 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 } 1208 1283 } 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; 1213 1312 } 1214 1313 … … 1238 1337 }; 1239 1338 1240 /* YYDEFACT[S] -- default r ule to reduce with in state S when YYTABLE1241 doesn't specify something else to do. Zero means the default is an1242 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. */ 1243 1342 const unsigned char 1244 1343 EasyMeshParser::yydefact_[] = … … 1282 1381 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 1283 1382 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. */ 1285 1384 const signed char EasyMeshParser::yytable_ninf_ = -1; 1286 1385 const unsigned char … … 1606 1705 } // lol 1607 1706 1608 /* Line 1 053of lalr1.cc */1609 #line 1 610"generated/easymesh-parser.cpp"1610 1611 1612 /* Line 1 055of lalr1.cc */1707 /* Line 1136 of lalr1.cc */ 1708 #line 1709 "generated/easymesh-parser.cpp" 1709 1710 1711 /* Line 1138 of lalr1.cc */ 1613 1712 #line 213 "easymesh/easymesh-parser.y" 1614 1713 -
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. */ 2 2 3 3 /* Skeleton interface for Bison LALR(1) parsers in C++ 4 4 5 Copyright (C) 2002-201 0Free Software Foundation, Inc.5 Copyright (C) 2002-2011 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 41 41 #include <iostream> 42 42 #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 } // lol53 54 /* Line 34 of lalr1.cc */55 #line 56 "generated/easymesh-parser.h"56 57 43 #include "location.hh" 58 44 … … 75 61 #endif 76 62 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 ends79 the previous symbol: RHS[0] (always defined). */80 81 #ifndef YYLLOC_DEFAULT82 # 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 #endif95 96 63 97 64 namespace lol { 98 65 99 /* Line 3 4of lalr1.cc */100 #line 101"generated/easymesh-parser.h"66 /* Line 35 of lalr1.cc */ 67 #line 68 "generated/easymesh-parser.h" 101 68 102 69 /// A Bison parser. … … 109 76 { 110 77 111 /* Line 3 4of lalr1.cc */78 /* Line 35 of lalr1.cc */ 112 79 #line 36 "easymesh/easymesh-parser.y" 113 80 … … 119 86 120 87 121 /* Line 3 4of lalr1.cc */122 #line 123"generated/easymesh-parser.h"88 /* Line 35 of lalr1.cc */ 89 #line 90 "generated/easymesh-parser.h" 123 90 }; 124 91 #else … … 266 233 location_stack_type yylocation_stack_; 267 234 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 268 243 /// Internal symbol numbers. 269 244 typedef unsigned char token_number_type; … … 273 248 static const signed char yypact_ninf_; 274 249 275 /// For a state, default r ule to reduce.250 /// For a state, default reduction number. 276 251 /// Unless\a yytable_ specifies something else to do. 277 252 /// Zero means the default is an error. … … 304 279 #endif 305 280 306 #if YYERROR_VERBOSE307 281 /// 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); 310 283 311 284 #if YYDEBUG … … 365 338 } // lol 366 339 367 /* Line 3 4of lalr1.cc */368 #line 3 69"generated/easymesh-parser.h"340 /* Line 35 of lalr1.cc */ 341 #line 342 "generated/easymesh-parser.h" 369 342 370 343 -
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. */ 2 2 3 3 /* Locations for Bison parsers in C++ 4 4 5 Copyright (C) 2002-2007, 2009-201 0Free Software Foundation, Inc.5 Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc. 6 6 7 7 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. */ 2 2 3 3 /* Skeleton implementation for Bison LALR(1) parsers in C++ 4 4 5 Copyright (C) 2002-201 0Free Software Foundation, Inc.5 Copyright (C) 2002-2011 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 36 36 /* First part of user declarations. */ 37 37 38 /* Line 310of lalr1.cc */38 /* Line 293 of lalr1.cc */ 39 39 #line 1 "gpu/lolfx-parser.y" 40 40 … … 59 59 60 60 61 /* Line 310of lalr1.cc */61 /* Line 293 of lalr1.cc */ 62 62 #line 63 "generated/lolfx-parser.cpp" 63 63 … … 67 67 /* User implementation prologue. */ 68 68 69 /* Line 316of lalr1.cc */69 /* Line 299 of lalr1.cc */ 70 70 #line 241 "gpu/lolfx-parser.y" 71 71 … … 76 76 77 77 78 /* Line 316of lalr1.cc */78 /* Line 299 of lalr1.cc */ 79 79 #line 80 "generated/lolfx-parser.cpp" 80 80 … … 91 91 #endif 92 92 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 93 113 /* Suppress unused-variable warnings by "using" E. */ 94 114 #define YYUSE(e) ((void) (e)) … … 142 162 namespace lol { 143 163 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" 147 166 148 167 /* Return YYSTR after stripping away unnecessary quotes and … … 183 202 } 184 203 185 #endif186 204 187 205 /// Build a parser object. … … 284 302 #endif 285 303 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 286 316 int 287 317 LolFxParser::parse () … … 305 335 location_type yylloc; 306 336 /// The locations where the error started and ended. 307 location_type yyerror_range[ 2];337 location_type yyerror_range[3]; 308 338 309 339 /// $$. … … 343 373 /* Try to take a decision without lookahead. */ 344 374 yyn = yypact_[yystate]; 345 if (yy n == yypact_ninf_)375 if (yy_pact_value_is_default_ (yyn)) 346 376 goto yydefault; 347 377 … … 376 406 if (yyn <= 0) 377 407 { 378 if (yy n == 0 || yyn == yytable_ninf_)379 goto yyerrlab;408 if (yy_table_value_is_error_ (yyn)) 409 goto yyerrlab; 380 410 yyn = -yyn; 381 411 goto yyreduce; … … 433 463 case 202: 434 464 435 /* Line 6 77of lalr1.cc */465 /* Line 690 of lalr1.cc */ 436 466 #line 728 "gpu/lolfx-parser.y" 437 467 { std::cout << "New tech " << std::endl; } … … 440 470 case 203: 441 471 442 /* Line 6 77of lalr1.cc */472 /* Line 690 of lalr1.cc */ 443 473 #line 736 "gpu/lolfx-parser.y" 444 474 { std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; } … … 447 477 case 204: 448 478 449 /* Line 6 77of lalr1.cc */479 /* Line 690 of lalr1.cc */ 450 480 #line 737 "gpu/lolfx-parser.y" 451 481 { std::cout << "New name " << (yysemantic_stack_[(1) - (1)].sval) << std::endl; } … … 454 484 case 207: 455 485 456 /* Line 6 77of lalr1.cc */486 /* Line 690 of lalr1.cc */ 457 487 #line 750 "gpu/lolfx-parser.y" 458 488 { std::cout << "New pass " << std::endl; } … … 461 491 case 226: 462 492 463 /* Line 6 77of lalr1.cc */493 /* Line 690 of lalr1.cc */ 464 494 #line 786 "gpu/lolfx-parser.y" 465 495 { std::cout << "new shader" << std::endl; } … … 468 498 469 499 470 /* Line 6 77of lalr1.cc */471 #line 472 "generated/lolfx-parser.cpp"500 /* Line 690 of lalr1.cc */ 501 #line 502 "generated/lolfx-parser.cpp" 472 502 default: 473 503 break; 474 504 } 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. */ 475 516 YY_SYMBOL_PRINT ("-> $$ =", yyr1_[yyn], &yyval, &yyloc); 476 517 … … 496 537 `------------------------------------*/ 497 538 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 498 543 /* If not already recovering from an error, report this error. */ 499 544 if (!yyerrstatus_) 500 545 { 501 546 ++yynerrs_; 547 if (yychar == yyempty_) 548 yytoken = yyempty_; 502 549 error (yylloc, yysyntax_error_ (yystate, yytoken)); 503 550 } 504 551 505 yyerror_range[ 0] = yylloc;552 yyerror_range[1] = yylloc; 506 553 if (yyerrstatus_ == 3) 507 554 { … … 538 585 goto yyerrorlab; 539 586 540 yyerror_range[ 0] = yylocation_stack_[yylen - 1];587 yyerror_range[1] = yylocation_stack_[yylen - 1]; 541 588 /* Do not reclaim the symbols of the rule which action triggered 542 589 this YYERROR. */ … … 555 602 { 556 603 yyn = yypact_[yystate]; 557 if ( yyn != yypact_ninf_)604 if (!yy_pact_value_is_default_ (yyn)) 558 605 { 559 606 yyn += yyterror_; … … 570 617 YYABORT; 571 618 572 yyerror_range[ 0] = yylocation_stack_[0];619 yyerror_range[1] = yylocation_stack_[0]; 573 620 yydestruct_ ("Error: popping", 574 621 yystos_[yystate], … … 579 626 } 580 627 581 yyerror_range[ 1] = yylloc;628 yyerror_range[2] = yylloc; 582 629 // Using YYLLOC is tempting, but would change the location of 583 630 // the lookahead. YYLOC is available though. 584 YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2);631 YYLLOC_DEFAULT (yyloc, yyerror_range, 2); 585 632 yysemantic_stack_.push (yylval); 586 633 yylocation_stack_.push (yyloc); … … 605 652 yyreturn: 606 653 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 } 608 661 609 662 /* Do not reclaim the symbols of the rule which action triggered … … 624 677 // Generate an error message. 625 678 std::string 626 LolFxParser::yysyntax_error_ (int yystate, int tok)679 LolFxParser::yysyntax_error_ (int yystate, int yytoken) 627 680 { 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_) 633 716 { 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 } 666 741 } 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; 671 770 } 672 771 … … 747 846 }; 748 847 749 /* YYDEFACT[S] -- default r ule to reduce with in state S when YYTABLE750 doesn't specify something else to do. Zero means the default is an751 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. */ 752 851 const unsigned short int 753 852 LolFxParser::yydefact_[] = … … 856 955 /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If 857 956 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. */ 859 958 const short int LolFxParser::yytable_ninf_ = -323; 860 959 const short int … … 3792 3891 } // lol 3793 3892 3794 /* Line 1 053of lalr1.cc */3795 #line 3 796"generated/lolfx-parser.cpp"3796 3797 3798 /* Line 1 055of lalr1.cc */3893 /* Line 1136 of lalr1.cc */ 3894 #line 3895 "generated/lolfx-parser.cpp" 3895 3896 3897 /* Line 1138 of lalr1.cc */ 3799 3898 #line 1298 "gpu/lolfx-parser.y" 3800 3899 -
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. */ 2 2 3 3 /* Skeleton interface for Bison LALR(1) parsers in C++ 4 4 5 Copyright (C) 2002-201 0Free Software Foundation, Inc.5 Copyright (C) 2002-2011 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 41 41 #include <iostream> 42 42 #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 } // lol53 54 /* Line 34 of lalr1.cc */55 #line 56 "generated/lolfx-parser.h"56 57 43 #include "location.hh" 58 44 … … 75 61 #endif 76 62 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 ends79 the previous symbol: RHS[0] (always defined). */80 81 #ifndef YYLLOC_DEFAULT82 # 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 #endif95 96 63 97 64 namespace lol { 98 65 99 /* Line 3 4of lalr1.cc */100 #line 101"generated/lolfx-parser.h"66 /* Line 35 of lalr1.cc */ 67 #line 68 "generated/lolfx-parser.h" 101 68 102 69 /// A Bison parser. … … 109 76 { 110 77 111 /* Line 3 4of lalr1.cc */78 /* Line 35 of lalr1.cc */ 112 79 #line 34 "gpu/lolfx-parser.y" 113 80 … … 119 86 120 87 121 /* Line 3 4of lalr1.cc */122 #line 123"generated/lolfx-parser.h"88 /* Line 35 of lalr1.cc */ 89 #line 90 "generated/lolfx-parser.h" 123 90 }; 124 91 #else … … 641 608 location_stack_type yylocation_stack_; 642 609 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 643 618 /// Internal symbol numbers. 644 619 typedef unsigned short int token_number_type; … … 648 623 static const short int yypact_ninf_; 649 624 650 /// For a state, default r ule to reduce.625 /// For a state, default reduction number. 651 626 /// Unless\a yytable_ specifies something else to do. 652 627 /// Zero means the default is an error. … … 679 654 #endif 680 655 681 #if YYERROR_VERBOSE682 656 /// 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); 685 658 686 659 #if YYDEBUG … … 740 713 } // lol 741 714 742 /* Line 3 4of lalr1.cc */743 #line 7 44"generated/lolfx-parser.h"715 /* Line 35 of lalr1.cc */ 716 #line 717 "generated/lolfx-parser.h" 744 717 745 718 -
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. */ 2 2 3 3 /* Positions for Bison parsers in C++ 4 4 5 Copyright (C) 2002-2007, 2009-201 0Free Software Foundation, Inc.5 Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc. 6 6 7 7 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. */ 2 2 3 3 /* Stack handling for Bison parsers in C++ 4 4 5 Copyright (C) 2002-201 0Free Software Foundation, Inc.5 Copyright (C) 2002-2011 Free Software Foundation, Inc. 6 6 7 7 This program is free software: you can redistribute it and/or modify … … 39 39 namespace lol { 40 40 41 /* Line 1 066of lalr1.cc */41 /* Line 1149 of lalr1.cc */ 42 42 #line 43 "generated/stack.hh" 43 43 template <class T, class S = std::deque<T> > … … 129 129 } // lol 130 130 131 /* Line 1 152of lalr1.cc */131 /* Line 1235 of lalr1.cc */ 132 132 #line 133 "generated/stack.hh" 133 133 -
trunk/src/gpu/framebuffer.cpp
r2480 r2506 68 68 D3DUSAGE_RENDERTARGET, 69 69 D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, 70 &m_data->m_texture, NULL)))70 &m_data->m_texture, nullptr))) 71 71 Abort(); 72 72 if (FAILED(m_data->m_texture->GetSurfaceLevel(0, &m_data->m_surface))) … … 75 75 if (FAILED(g_d3ddevice->CreateTexture(size.x, size.y, 1, 0, 76 76 D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, 77 &m_data->m_texture, NULL)))77 &m_data->m_texture, nullptr))) 78 78 Abort(); 79 79 if (FAILED(g_d3ddevice->CreateRenderTarget(size.x, size.y, 80 80 D3DFMT_A8R8G8B8, 81 81 D3DMULTISAMPLE_NONE, 0, 0, 82 &m_data->m_surface, NULL)))82 &m_data->m_surface, nullptr))) 83 83 Abort(); 84 84 #else … … 115 115 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, (GLenum)filtering); 116 116 glTexImage2D(GL_TEXTURE_2D, 0, internal_format, size.x, size.y, 0, 117 format, GL_UNSIGNED_BYTE, NULL);117 format, GL_UNSIGNED_BYTE, nullptr); 118 118 119 119 # if GL_VERSION_1_1 || GL_ES_VERSION_2_0 … … 201 201 m_data->m_back_surface->Release(); 202 202 #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))) 206 206 Abort(); 207 207 if (FAILED(g_d3ddevice->SetRenderTarget(0, m_data->m_back_surface))) -
trunk/src/gpu/indexbuffer.cpp
r2216 r2506 68 68 if (FAILED(g_d3ddevice->CreateIndexBuffer(size, D3DUSAGE_WRITEONLY, 69 69 D3DFMT_INDEX16, D3DPOOL_MANAGED, 70 &m_data->m_ibo, NULL)))70 &m_data->m_ibo, nullptr))) 71 71 Abort(); 72 72 #else … … 94 94 { 95 95 if (!m_data->m_size) 96 return NULL;96 return nullptr; 97 97 98 98 #if defined USE_D3D9 || defined _XBOX … … 143 143 144 144 #if defined USE_D3D9 || defined _XBOX 145 if (FAILED(g_d3ddevice->SetIndices( NULL)))145 if (FAILED(g_d3ddevice->SetIndices(nullptr))) 146 146 Abort(); 147 147 #else -
trunk/src/gpu/shader.cpp
r2291 r2506 92 92 /* Parse the crap */ 93 93 Array<char const *, char const *> sections; 94 char *key = NULL;94 char *key = nullptr; 95 95 for (char *parser = src; *parser; ) 96 96 { 97 if (key == NULL&& (parser[0] == '\n' || parser[0] == '\r')97 if (key == nullptr && (parser[0] == '\n' || parser[0] == '\r') 98 98 && parser[1] == '[') 99 99 { … … 110 110 sections.Push(key, parser); 111 111 parser++; 112 key = NULL;112 key = nullptr; 113 113 } 114 114 else … … 118 118 } 119 119 120 char const *vert = NULL, *frag = NULL;120 char const *vert = nullptr, *frag = nullptr; 121 121 for (int i = 0; i < sections.Count(); i++) 122 122 { … … 178 178 { "_XBOX", "1" }, 179 179 #endif 180 { NULL, NULL}180 { nullptr, nullptr } 181 181 }; 182 182 #elif !defined __CELLOS_LV2__ … … 194 194 data->vert_crc = ShaderData::hash(vert); 195 195 #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", 197 197 "vs_3_0", 0, &shader_code, &error_msg, 198 198 &data->vert_table); … … 207 207 shader_code->Release(); 208 208 #elif !defined __CELLOS_LV2__ 209 ShaderData::Patch(buf, vert, NULL);209 ShaderData::Patch(buf, vert, nullptr); 210 210 data->vert_id = glCreateShader(GL_VERTEX_SHADER); 211 glShaderSource(data->vert_id, 1, &shader, NULL);211 glShaderSource(data->vert_id, 1, &shader, nullptr); 212 212 glCompileShader(data->vert_id); 213 213 … … 227 227 data->vert_id = cgCreateProgram(cgCreateContext(), CG_SOURCE, vert, 228 228 cgGLGetLatestProfile(CG_GL_VERTEX), 229 NULL, NULL);230 if (data->vert_id == NULL)229 nullptr, nullptr); 230 if (data->vert_id == nullptr) 231 231 { 232 232 Log::Error("failed to compile vertex shader"); … … 238 238 data->frag_crc = ShaderData::hash(frag); 239 239 #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", 241 241 "ps_3_0", 0, &shader_code, &error_msg, 242 242 &data->frag_table); … … 251 251 shader_code->Release(); 252 252 #elif !defined __CELLOS_LV2__ 253 ShaderData::Patch(buf, NULL, frag);253 ShaderData::Patch(buf, nullptr, frag); 254 254 data->frag_id = glCreateShader(GL_FRAGMENT_SHADER); 255 glShaderSource(data->frag_id, 1, &shader, NULL);255 glShaderSource(data->frag_id, 1, &shader, nullptr); 256 256 glCompileShader(data->frag_id); 257 257 … … 271 271 data->frag_id = cgCreateProgram(cgCreateContext(), CG_SOURCE, frag, 272 272 cgGLGetLatestProfile(CG_GL_FRAGMENT), 273 NULL, NULL);274 if (data->frag_id == NULL)273 nullptr, nullptr); 274 if (data->frag_id == nullptr) 275 275 { 276 276 Log::Error("failed to compile fragment shader"); … … 287 287 D3DXCONSTANT_DESC cdesc; 288 288 UINT count = 1; 289 D3DXHANDLE h = data->frag_table->GetConstant( NULL, i);289 D3DXHANDLE h = data->frag_table->GetConstant(nullptr, i); 290 290 data->frag_table->GetConstantDesc(h, &cdesc, &count); 291 291 } … … 295 295 D3DXCONSTANT_DESC cdesc; 296 296 UINT count = 1; 297 D3DXHANDLE h = data->vert_table->GetConstant( NULL, i);297 D3DXHANDLE h = data->vert_table->GetConstant(nullptr, i); 298 298 data->frag_table->GetConstantDesc(h, &cdesc, &count); 299 299 } … … 352 352 353 353 count = 0; 354 hr = data->frag_table->GetConstantByName( NULL, tmpname);354 hr = data->frag_table->GetConstantByName(nullptr, tmpname); 355 355 if (hr) 356 356 data->frag_table->GetConstantDesc(hr, &cdesc, &count); … … 362 362 363 363 count = 0; 364 hr = data->vert_table->GetConstantByName( NULL, tmpname);364 hr = data->vert_table->GetConstantByName(nullptr, tmpname); 365 365 if (hr) 366 366 data->vert_table->GetConstantDesc(hr, &cdesc, &count); … … 676 676 #if defined USE_D3D9 || defined _XBOX 677 677 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); 680 680 #elif !defined __CELLOS_LV2__ 681 681 /* FIXME: untested */ … … 729 729 "#version 130\n" 730 730 "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); 732 732 glCompileShader(id); 733 733 glGetShaderInfoLog(id, sizeof(buf), &len, buf); … … 741 741 "#version 120\n" 742 742 "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); 744 744 glCompileShader(id); 745 745 glGetShaderInfoLog(id, sizeof(buf), &len, buf); … … 836 836 #endif 837 837 838 NULL838 nullptr 839 839 }; 840 840 … … 866 866 "out vec4", "varying vec4", 867 867 "out mat4", "varying mat4", 868 NULL868 nullptr 869 869 }; 870 870 -
trunk/src/gpu/texture.cpp
r2315 r2506 116 116 g_d3ddevice->CreateTexture(m_data->m_size.x, m_data->m_size.y, 1, 117 117 d3d_usage, d3d_format, 118 D3DPOOL_DEFAULT, &m_data->m_texture, NULL);118 D3DPOOL_DEFAULT, &m_data->m_texture, nullptr); 119 119 m_data->m_bytes_per_elem = GET_CLAMPED(d3d_formats, format).bytes; 120 120 #else … … 197 197 D3DLOCKED_RECT rect; 198 198 # 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); 202 202 # endif 203 203 … … 217 217 #if defined _XBOX || defined USE_D3D9 218 218 D3DLOCKED_RECT rect; 219 m_data->m_texture->LockRect(0, &rect, NULL, 0);219 m_data->m_texture->LockRect(0, &rect, nullptr, 0); 220 220 221 221 int stride = size.x * m_data->m_bytes_per_elem; -
trunk/src/gpu/vertexbuffer.cpp
r2497 r2506 613 613 return; 614 614 #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))) 617 617 Abort(); 618 618 #else … … 640 640 { 641 641 if (!m_data->m_size) 642 return NULL;642 return nullptr; 643 643 #if defined USE_D3D9 || defined _XBOX 644 644 void *ret; -
trunk/src/gradient.cpp
r2476 r2506 49 49 m_bbox[1] = bb; 50 50 51 data->shader = NULL;51 data->shader = nullptr; 52 52 } 53 53 -
trunk/src/image/codec/android-image.cpp
r2183 r2506 56 56 Log::Error("JVM environment not found, trying to attach thread\n"); 57 57 #endif 58 res = g_vm->AttachCurrentThread(&env, NULL);58 res = g_vm->AttachCurrentThread(&env, nullptr); 59 59 } 60 60 if (res < 0) -
trunk/src/image/codec/gdiplus-image.cpp
r2381 r2506 54 54 ULONG_PTR token; 55 55 Gdiplus::GdiplusStartupInput input; 56 status = Gdiplus::GdiplusStartup(&token, &input, NULL);56 status = Gdiplus::GdiplusStartup(&token, &input, nullptr); 57 57 if (status != Gdiplus::Ok) 58 58 { … … 64 64 65 65 Array<String> pathlist = System::GetPathList(path); 66 m_bitmap = NULL;66 m_bitmap = nullptr; 67 67 for (int i = 0; i < pathlist.Count(); ++i) 68 68 { 69 69 size_t len; 70 len = mbstowcs( NULL, pathlist[i].C(), 0);70 len = mbstowcs(nullptr, pathlist[i].C(), 0); 71 71 wchar_t *wpath = new wchar_t[len + 1]; 72 72 if (mbstowcs(wpath, pathlist[i].C(), len + 1) == (size_t)-1) … … 93 93 #endif 94 94 delete m_bitmap; 95 m_bitmap = NULL;95 m_bitmap = nullptr; 96 96 } 97 97 } -
trunk/src/image/codec/ps3-image.cpp
r2382 r2506 78 78 in_param.spuThreadPriority = 200; 79 79 in_param.cbCtrlMallocFunc = Ps3ImageData::Malloc; 80 in_param.cbCtrlMallocArg = NULL;80 in_param.cbCtrlMallocArg = nullptr; 81 81 in_param.cbCtrlFreeFunc = Ps3ImageData::Free; 82 in_param.cbCtrlFreeArg = NULL;82 in_param.cbCtrlFreeArg = nullptr; 83 83 CellPngDecThreadOutParam out_param; 84 84 err = cellPngDecCreate(&hmain, &in_param, &out_param); … … 96 96 dec_src.fileOffset = 0; 97 97 dec_src.fileSize = 0; 98 dec_src.streamPtr = NULL;98 dec_src.streamPtr = nullptr; 99 99 dec_src.streamSize = 0; 100 100 dec_src.spuThreadEnable = CELL_PNGDEC_SPU_THREAD_ENABLE; … … 130 130 131 131 CellPngDecInParam in_dec_param; 132 in_dec_param.commandPtr = NULL;132 in_dec_param.commandPtr = nullptr; 133 133 in_dec_param.outputMode = CELL_PNGDEC_TOP_TO_BOTTOM; 134 134 in_dec_param.outputColorSpace = CELL_PNGDEC_RGBA; -
trunk/src/image/codec/sdl-image.cpp
r2381 r2506 79 79 { 80 80 SDL_Surface *tmp = Create32BppSurface(size); 81 SDL_BlitSurface(m_img, NULL, tmp, NULL);81 SDL_BlitSurface(m_img, nullptr, tmp, nullptr); 82 82 SDL_FreeSurface(m_img); 83 83 m_img = tmp; -
trunk/src/image/image-private.h
r2183 r2506 40 40 static ImageData *Load(char const *path) 41 41 { 42 ImageLoader *parser = Helper( NULL);43 ImageData *ret = NULL;42 ImageLoader *parser = Helper(nullptr); 43 ImageData *ret = nullptr; 44 44 45 45 while (parser && !ret) … … 54 54 static ImageLoader *Helper(ImageLoader *set) 55 55 { 56 static ImageLoader *loaders = NULL;56 static ImageLoader *loaders = nullptr; 57 57 58 58 if (!set) … … 65 65 *parser = set; 66 66 67 return NULL;67 return nullptr; 68 68 } 69 69 }; … … 107 107 { \ 108 108 delete ret; \ 109 return NULL; \109 return nullptr; \ 110 110 } \ 111 111 return ret; \ -
trunk/src/input/input.cpp
r2300 r2506 32 32 */ 33 33 34 InputTracker* Input::m_input_tracker = NULL;34 InputTracker* Input::m_input_tracker = nullptr; 35 35 36 36 static class InputData … … 117 117 #if defined USE_SDL 118 118 # if SDL_VERSION_ATLEAST(1,3,0) 119 Uint8 *keystate = SDL_GetKeyboardState( NULL);119 Uint8 *keystate = SDL_GetKeyboardState(nullptr); 120 120 # else 121 Uint8 *keystate = SDL_GetKeyState( NULL);121 Uint8 *keystate = SDL_GetKeyState(nullptr); 122 122 # endif 123 123 //SOOOoooo ugly. … … 271 271 /* Simulate a joystick using the keyboard. This SDL call is free. */ 272 272 # if SDL_VERSION_ATLEAST(1,3,0) 273 Uint8 *keystate = SDL_GetKeyboardState( NULL);273 Uint8 *keystate = SDL_GetKeyboardState(nullptr); 274 274 # else 275 Uint8 *keystate = SDL_GetKeyState( NULL);275 Uint8 *keystate = SDL_GetKeyState(nullptr); 276 276 # endif 277 277 int left = keystate[SDLK_d] - (keystate[SDLK_a] | keystate[SDLK_q]); … … 304 304 #if defined USE_SDL 305 305 # if SDL_VERSION_ATLEAST(1,3,0) 306 Uint8 *keystate = SDL_GetKeyboardState( NULL);306 Uint8 *keystate = SDL_GetKeyboardState(nullptr); 307 307 # else 308 Uint8 *keystate = SDL_GetKeyState( NULL);308 Uint8 *keystate = SDL_GetKeyState(nullptr); 309 309 # endif 310 310 return keystate[button]; … … 402 402 data->mouse = coord; 403 403 404 WorldEntity *top = NULL;404 WorldEntity *top = nullptr; 405 405 406 406 /* Find the top “widget” amongst all entities that match the … … 487 487 /* FIXME: add the possibility to choose amongst sticks */ 488 488 if (desired >= data->m_sticks.Count()) 489 return NULL;489 return nullptr; 490 490 Ticker::Ref(data->m_sticks[desired]); 491 491 return data->m_sticks[desired]; -
trunk/src/lol/base/assert.h
r2479 r2506 20 20 { 21 21 #if defined __CELLOS_LV2__ 22 *(uint32_t *) NULL= 0xdead;22 *(uint32_t *)nullptr = 0xdead; 23 23 #else 24 24 std::abort(); -
trunk/src/lol/gpu/vertexbuffer.h
r2497 r2506 121 121 template<typename T> inline void AddStream(int n, VertexUsage usage) 122 122 { 123 m_streams[n].stream_type = GetType((T *) NULL);123 m_streams[n].stream_type = GetType((T *)nullptr); 124 124 m_streams[n].usage = usage; 125 125 m_streams[n].size = sizeof(T); -
trunk/src/lol/math/remez.h
r2394 r2506 75 75 inline void Run(T a, T b, RealFunc *func, int decimals) 76 76 { 77 Run(a, b, func, NULL, decimals);77 Run(a, b, func, nullptr, decimals); 78 78 } 79 79 -
trunk/src/map.cpp
r2216 r2506 57 57 char tmp[BUFSIZ]; 58 58 int gids[LevelMapData::MAX_TILESETS]; 59 uint32_t *tiles = NULL;59 uint32_t *tiles = nullptr; 60 60 int level = 0, orientation = 0, ntiles = 0; 61 61 … … 119 119 level, orientation, tiles); 120 120 data->m_layers.Push(l); 121 tiles = NULL;121 tiles = nullptr; 122 122 //Log::Debug("new layer %ix%i\n", data->width, data->height); 123 123 } -
trunk/src/platform/android/androidapp.cpp
r2297 r2506 70 70 { 71 71 int argc = 1; 72 char *argv[] = { "", NULL};73 char *env[] = { NULL};72 char *argv[] = { "", nullptr }; 73 char *env[] = { nullptr }; 74 74 75 75 /* Call the user's main() function. One of these will work. */ … … 78 78 lol_android_main(argc, argv, env); 79 79 80 return NULL;80 return nullptr; 81 81 } 82 82 … … 108 108 /* Initialise app thread and wait for it to be ready, ie. set 109 109 * 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); 111 111 g_main_queue.Pop(); 112 112 -
trunk/src/platform/nacl/nacl-instance.cpp
r1440 r2506 92 92 /* Ensure only one NaClInstance does Init() at the same time. */ 93 93 main_mutex.Lock(); 94 char *env[] = { NULL};94 char *env[] = { nullptr }; 95 95 Args arglist(argc, const_cast<char **>(argv), const_cast<char **>(env)); 96 96 main_queue.Push(&arglist); 97 m_main_thread = new Thread(MainRun, NULL);97 m_main_thread = new Thread(MainRun, nullptr); 98 98 /* 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); 101 101 main_mutex.Unlock(); 102 102 … … 121 121 lol_nacl_main(arglist->m_argc, arglist->m_argv, arglist->m_env); 122 122 123 return NULL;123 return nullptr; 124 124 } 125 125 … … 146 146 m_size = ivec2(position.size().width(), position.size().height()); 147 147 148 if (m_opengl_ctx == NULL)148 if (m_opengl_ctx == nullptr) 149 149 m_opengl_ctx.reset(new OpenGLContext(this)); 150 150 m_opengl_ctx->InvalidateContext(this); … … 178 178 void NaClInstance::DrawSelf() 179 179 { 180 if (m_opengl_ctx == NULL)180 if (m_opengl_ctx == nullptr) 181 181 return; 182 182 -
trunk/src/platform/nacl/opengl_context.cpp
r1084 r2506 39 39 } 40 40 41 bool OpenGLContext::MakeContextCurrent(pp::Instance* instance) { 42 if (instance == NULL) { 41 bool OpenGLContext::MakeContextCurrent(pp::Instance* instance) 42 { 43 if (instance == nullptr) 44 { 43 45 glSetCurrentContextPPAPI(0); 44 46 return false; -
trunk/src/platform/ps3/ps3app.cpp
r2316 r2506 64 64 cellSysmoduleLoadModule(CELL_SYSMODULE_IO); 65 65 66 cellSysutilRegisterCallback(0, Ps3AppData::SysCallBack, NULL);66 cellSysutilRegisterCallback(0, Ps3AppData::SysCallBack, nullptr); 67 67 68 68 PSGLinitOptions psglio; -
trunk/src/platform/ps3/threadbase.h
r2183 r2506 137 137 virtual ~ThreadBase() 138 138 { 139 sys_ppu_thread_join(m_thread, NULL);139 sys_ppu_thread_join(m_thread, nullptr); 140 140 } 141 141 -
trunk/src/platform/sdl/sdlapp.cpp
r2301 r2506 34 34 35 35 #if defined USE_SDL && defined USE_D3D9 36 HWND g_hwnd = NULL;36 HWND g_hwnd = nullptr; 37 37 extern IDirect3DDevice9 *g_d3ddevice; 38 38 #endif … … 88 88 } 89 89 90 SDL_WM_SetCaption(title, NULL);90 SDL_WM_SetCaption(title, nullptr); 91 91 92 92 /* Initialise everything */ … … 127 127 if (FAILED(hr)) 128 128 Abort(); 129 hr = g_d3ddevice->Present( NULL, NULL, NULL, NULL);129 hr = g_d3ddevice->Present(nullptr, nullptr, nullptr, nullptr); 130 130 if (FAILED(hr)) 131 131 Abort(); -
trunk/src/platform/sdl/sdlinput.cpp
r2216 r2506 197 197 /* Send the whole keyboard state to the input system */ 198 198 #if 0 199 Uint8 *keystate = SDL_GetKeyState( NULL);199 Uint8 *keystate = SDL_GetKeyState(nullptr); 200 200 for (int i = 0; i < 256; i++) 201 201 if (keystate[i]) -
trunk/src/platform/xbox/xboxapp.cpp
r2222 r2506 68 68 69 69 #if defined _XBOX 70 g_d3ddevice->Present( NULL, NULL, NULL, NULL);70 g_d3ddevice->Present(nullptr, nullptr, nullptr, nullptr); 71 71 #endif 72 72 } -
trunk/src/scene.cpp
r2500 r2506 76 76 }; 77 77 78 Scene *SceneData::scene = NULL;78 Scene *SceneData::scene = nullptr; 79 79 80 80 /* -
trunk/src/sys/file.cpp
r2363 r2506 57 57 if (m_fd) 58 58 fclose(m_fd); 59 m_fd = NULL;59 m_fd = nullptr; 60 60 #endif 61 61 } -
trunk/src/sys/init.cpp
r2403 r2506 50 50 51 51 #if defined HAVE_GETCWD 52 char *cwd = getcwd( NULL, 0);52 char *cwd = getcwd(nullptr, 0); 53 53 #elif defined HAVE__GETCWD || (defined _WIN32 && !defined _XBOX) 54 char *cwd = _getcwd( NULL, 0);54 char *cwd = _getcwd(nullptr, 0); 55 55 #else 56 char *cwd = NULL;56 char *cwd = nullptr; 57 57 #endif 58 58 String binarydir = String(cwd ? cwd : ".") + SEPARATOR; -
trunk/src/sys/threadbase.h
r2238 r2506 40 40 { 41 41 #if defined HAVE_PTHREAD_H 42 pthread_mutex_init(&m_mutex, NULL);42 pthread_mutex_init(&m_mutex, nullptr); 43 43 #elif defined _WIN32 44 44 InitializeCriticalSection(&m_mutex); … … 89 89 #if defined HAVE_PTHREAD_H 90 90 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); 97 97 InitializeCriticalSection(&m_mutex); 98 98 #endif … … 137 137 #elif defined _WIN32 138 138 LeaveCriticalSection(&m_mutex); 139 ReleaseSemaphore(m_full_sem, 1, NULL);139 ReleaseSemaphore(m_full_sem, 1, nullptr); 140 140 #endif 141 141 } … … 169 169 #else 170 170 LeaveCriticalSection(&m_mutex); 171 ReleaseSemaphore(m_empty_sem, 1, NULL);171 ReleaseSemaphore(m_empty_sem, 1, nullptr); 172 172 #endif 173 173 … … 201 201 pthread_create(&m_thread, &attr, fn, data); 202 202 #elif defined _WIN32 203 m_thread = CreateThread( NULL, 0, (LPTHREAD_START_ROUTINE)fn,203 m_thread = CreateThread(nullptr, 0, (LPTHREAD_START_ROUTINE)fn, 204 204 data, 0, &m_tid); 205 205 #endif … … 209 209 { 210 210 #if defined HAVE_PTHREAD_H 211 pthread_join(m_thread, NULL);211 pthread_join(m_thread, nullptr); 212 212 #elif defined _WIN32 213 213 WaitForSingleObject(m_thread, INFINITE); -
trunk/src/sys/timer.cpp
r2429 r2506 60 60 { 61 61 struct timeval tv, tv0 = m_tv; 62 gettimeofday(&tv, NULL);62 gettimeofday(&tv, nullptr); 63 63 if (reset) 64 64 m_tv = tv; -
trunk/src/text.cpp
r2377 r2506 46 46 { 47 47 data->font = Forge::Register(font); 48 data->text = text ? strdup(text) : NULL;48 data->text = text ? strdup(text) : nullptr; 49 49 data->length = text ? strlen(text) : 0; 50 50 data->pos = vec3(0, 0, 0); … … 57 57 if (data->text) 58 58 free(data->text); 59 data->text = text ? strdup(text) : NULL;59 data->text = text ? strdup(text) : nullptr; 60 60 data->length = text ? strlen(text) : 0; 61 61 } -
trunk/src/ticker.cpp
r2444 r2506 40 40 { 41 41 for (int i = 0; i < Entity::ALLGROUP_END; i++) 42 list[i] = NULL;42 list[i] = nullptr; 43 43 } 44 44 … … 115 115 void Ticker::Ref(Entity *entity) 116 116 { 117 ASSERT(entity, "dereferencing NULLentity\n");117 ASSERT(entity, "dereferencing nullptr entity\n"); 118 118 ASSERT(!entity->m_destroy, 119 119 "referencing entity scheduled for destruction %s\n", … … 125 125 * very fast since the first entry in autolist is the last 126 126 * registered entity. */ 127 for (Entity *e = data->autolist, *prev = NULL; e;127 for (Entity *e = data->autolist, *prev = nullptr; e; 128 128 prev = e, e = e->m_autonext) 129 129 { … … 142 142 int Ticker::Unref(Entity *entity) 143 143 { 144 ASSERT(entity, "dereferencing NULLentity\n");144 ASSERT(entity, "dereferencing null entity\n"); 145 145 ASSERT(entity->m_ref > 0, "dereferencing unreferenced entity %s\n", 146 146 entity->GetName()) … … 248 248 * inthe tick lists can be marked for destruction. */ 249 249 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; ) 251 251 { 252 252 if (e->m_destroy && i < Entity::GAMEGROUP_END) … … 322 322 #endif 323 323 324 return NULL;324 return nullptr; 325 325 } 326 326 … … 336 336 } 337 337 338 return NULL;338 return nullptr; 339 339 } 340 340 … … 344 344 data->disktick.Pop(); 345 345 346 return NULL;346 return nullptr; 347 347 } 348 348 … … 362 362 data->fps = fps; 363 363 364 data->gamethread = new Thread(TickerData::GameThreadMain, NULL);364 data->gamethread = new Thread(TickerData::GameThreadMain, nullptr); 365 365 data->gametick.Push(1); 366 366 367 data->diskthread = new Thread(TickerData::DiskThreadMain, NULL);367 data->diskthread = new Thread(TickerData::DiskThreadMain, nullptr); 368 368 } 369 369 -
trunk/src/tileset.cpp
r2439 r2506 71 71 sprintf(data->name, "<tileset> %s", path); 72 72 73 data->tiles = NULL;73 data->tiles = nullptr; 74 74 data->m_texture = 0; 75 75 data->img = new Image(path); … … 154 154 free(pixels); 155 155 delete data->img; 156 data->img = NULL;156 data->img = nullptr; 157 157 } 158 158 } -
trunk/src/video.cpp
r2480 r2506 308 308 if (m & ClearMask::Stencil) 309 309 mask |= D3DCLEAR_STENCIL; 310 if (FAILED(VideoData::d3d_dev->Clear(0, NULL, mask,310 if (FAILED(VideoData::d3d_dev->Clear(0, nullptr, mask, 311 311 VideoData::clear_color, 312 312 VideoData::clear_depth, 0))) -
trunk/tools/vimlol/vimlol.vim
r2181 r2506 40 40 \ float2 float3 float4 float2x2 float3x3 float4x4 41 41 42 " Ensure we know about nullptr 43 au Syntax cpp 44 \ syn keyword cConstant 45 \ nullptr 46 42 47 43 48 """
Note: See TracChangeset
for help on using the changeset viewer.