hmml_to_html.c: Test for annotator_count > 0

Without this it would try and read from the NULL pointer

Also increase the Menus size to 24kb
This commit is contained in:
Matt Mascarenhas 2017-06-22 00:16:09 +01:00
parent 0cb357a209
commit 716e694ccd
2 changed files with 79 additions and 25 deletions

View File

@ -1,25 +1,60 @@
.marker .content .categories .category.demo { border-color: hsl(335, 32%, 26%); background: hsl(335, 32%, 26%); }
.marker .content .categories .category.simulation { border-color: hsl(174, 92%, 26%); background: hsl(174, 92%, 26%); }
.marker .content .categories .category.threading { border-color: hsl(64, 8%, 26%); background: hsl(64, 8%, 26%); }
.marker .content .categories .category.language { border-color: hsl(251, 40%, 26%); background: hsl(251, 40%, 26%); }
.marker .content .categories .category.physics { border-color: hsl(218, 68%, 26%); background: hsl(218, 68%, 26%); }
.marker .content .categories .category.profiling { border-color: hsl(269, 88%, 26%); background: hsl(269, 88%, 26%); }
.marker .content .categories .category.optimisation { border-color: hsl(69, 92%, 26%); background: hsl(69, 92%, 26%); }
.marker .content .categories .category.input-handling { border-color: hsl(126, 94%, 26%); background: hsl(126, 94%, 26%); }
.marker .content .categories .category.ui { border-color: hsl(285, 12%, 26%); background: hsl(285, 12%, 26%); }
.marker .content .categories .category.rendering { border-color: hsl(146, 40%, 26%); background: hsl(146, 40%, 26%); }
.marker .content .categories .category.memory { border-color: hsl(126, 32%, 26%); background: hsl(126, 32%, 26%); }
.marker .content .categories .category.experience { border-color: hsl(236, 76%, 26%); background: hsl(236, 76%, 26%); }
.marker .content .categories .category.trivia { border-color: hsl(25, 92%, 26%); background: hsl(25, 92%, 26%); }
.marker .content .categories .category.audio { border-color: hsl(98, 80%, 26%); background: hsl(98, 80%, 26%); }
.marker .content .categories .category.sorting { border-color: hsl(250, 80%, 26%); background: hsl(250, 80%, 26%); }
.marker .content .categories .category.animation { border-color: hsl(167, 48%, 26%); background: hsl(167, 48%, 26%); }
.marker .content .categories .category.inventory { border-color: hsl(278, 32%, 26%); background: hsl(278, 32%, 26%); }
.marker .content .categories .category.font { border-color: hsl(161, 4%, 26%); background: hsl(161, 4%, 26%); }
.marker .content .categories .category.mathematics { border-color: hsl(308, 4%, 26%); background: hsl(308, 4%, 26%); }
.category.inventory { border: 1px solid hsl(111, 79%, 26%); background: hsl(111, 79%, 26%); }
.category.hardware { border: 1px solid hsl(284, 94%, 26%); background: hsl(284, 94%, 26%); }
.category.math { border: 1px solid hsl(185, 74%, 26%); background: hsl(185, 74%, 26%); }
.category.platform-layer { border: 1px solid hsl(160, 81%, 26%); background: hsl(160, 81%, 26%); }
.category.font { border: 1px solid hsl(13, 87%, 26%); background: hsl(13, 87%, 26%); }
.category.input-handling { border: 1px solid hsl(335, 94%, 26%); background: hsl(335, 94%, 26%); }
.category.inventory { border: 1px solid hsl(111, 79%, 26%); background: hsl(111, 79%, 26%); }
.category.hardware { border: 1px solid hsl(284, 94%, 26%); background: hsl(284, 94%, 26%); }
.category.math { border: 1px solid hsl(185, 74%, 26%); background: hsl(185, 74%, 26%); }
.category.demo { border: 1px solid hsl(113, 95%, 26%); background: hsl(113, 95%, 26%); }
.category.memory { border: 1px solid hsl(111, 89%, 26%); background: hsl(111, 89%, 26%); }
.category.mesh-building { border: 1px solid hsl(334, 99%, 26%); background: hsl(334, 99%, 26%); }
.category.rendering { border: 1px solid hsl(140, 79%, 26%); background: hsl(140, 79%, 26%); }
.category.procedural-generation { border: 1px solid hsl(186, 87%, 26%); background: hsl(186, 87%, 26%); }
.category.asset-loading { border: 1px solid hsl(18, 76%, 26%); background: hsl(18, 76%, 26%); }
.category.game-development { border: 1px solid hsl(58, 96%, 26%); background: hsl(58, 96%, 26%); }
.category.level-of-detail { border: 1px solid hsl(211, 97%, 26%); background: hsl(211, 97%, 26%); }
.category.lighting { border: 1px solid hsl(40, 76%, 26%); background: hsl(40, 76%, 26%); }
.category.game { border: 1px solid hsl(315, 84%, 26%); background: hsl(315, 84%, 26%); }
.category.optimisation { border: 1px solid hsl(327, 86%, 26%); background: hsl(327, 86%, 26%); }
.category.threading { border: 1px solid hsl(25, 97%, 26%); background: hsl(25, 97%, 26%); }
.category.maths { border: 1px solid hsl(84, 88%, 26%); background: hsl(84, 88%, 26%); }
.category.camera { border: 1px solid hsl(141, 89%, 26%); background: hsl(141, 89%, 26%); }
.category.collision { border: 1px solid hsl(342, 93%, 26%); background: hsl(342, 93%, 26%); }
.category.physics { border: 1px solid hsl(242, 94%, 26%); background: hsl(242, 94%, 26%); }
.category.movement { border: 1px solid hsl(341, 97%, 26%); background: hsl(341, 97%, 26%); }
.category.debug-visualisation { border: 1px solid hsl(60, 86%, 26%); background: hsl(60, 86%, 26%); }
.category.programming { border: 1px solid hsl(283, 84%, 26%); background: hsl(283, 84%, 26%); }
.category.networking { border: 1px solid hsl(10, 94%, 26%); background: hsl(10, 94%, 26%); }
.category.network { border: 1px solid hsl(342, 75%, 26%); background: hsl(342, 75%, 26%); }
.category.object-system { border: 1px solid hsl(87, 80%, 26%); background: hsl(87, 80%, 26%); }
.category.language { border: 1px solid hsl(142, 84%, 26%); background: hsl(142, 84%, 26%); }
.category.asm { border: 1px solid hsl(71, 92%, 26%); background: hsl(71, 92%, 26%); }
.category.game-design { border: 1px solid hsl(162, 92%, 26%); background: hsl(162, 92%, 26%); }
.category.art { border: 1px solid hsl(157, 76%, 26%); background: hsl(157, 76%, 26%); }
.category.entity-system { border: 1px solid hsl(275, 92%, 26%); background: hsl(275, 92%, 26%); }
.category.animation { border: 1px solid hsl(170, 81%, 26%); background: hsl(170, 81%, 26%); }
.category.sorting { border: 1px solid hsl(285, 97%, 26%); background: hsl(285, 97%, 26%); }
.category.particle-system { border: 1px solid hsl(116, 99%, 26%); background: hsl(116, 99%, 26%); }
.category.simulation { border: 1px solid hsl(328, 91%, 26%); background: hsl(328, 91%, 26%); }
.category.save---load { border: 1px solid hsl(120, 93%, 26%); background: hsl(120, 93%, 26%); }
.category.logistics { border: 1px solid hsl(54, 76%, 26%); background: hsl(54, 76%, 26%); }
.category.parsing { border: 1px solid hsl(27, 79%, 26%); background: hsl(27, 79%, 26%); }
.category.profiling { border: 1px solid hsl(314, 91%, 26%); background: hsl(314, 91%, 26%); }
.category.prng { border: 1px solid hsl(13, 87%, 26%); background: hsl(13, 87%, 26%); }
.category.ui { border: 1px solid hsl(43, 94%, 26%); background: hsl(43, 94%, 26%); }
.category.audio { border: 1px solid hsl(287, 77%, 26%); background: hsl(287, 77%, 26%); }
.category.pathfinding { border: 1px solid hsl(314, 87%, 26%); background: hsl(314, 87%, 26%); }
.category.simd { border: 1px solid hsl(229, 77%, 26%); background: hsl(229, 77%, 26%); }
.category.mesh-chunk { border: 1px solid hsl(75, 89%, 26%); background: hsl(75, 89%, 26%); }
.category.ai { border: 1px solid hsl(115, 74%, 26%); background: hsl(115, 74%, 26%); }
.category.driver { border: 1px solid hsl(285, 76%, 26%); background: hsl(285, 76%, 26%); }
.category.fabrication { border: 1px solid hsl(169, 77%, 26%); background: hsl(169, 77%, 26%); }
.category.peripheral { border: 1px solid hsl(327, 92%, 26%); background: hsl(327, 92%, 26%); }
.category.biology { border: 1px solid hsl(40, 80%, 26%); background: hsl(40, 80%, 26%); }
.category.mathematics { border: 1px solid hsl(9, 91%, 26%); background: hsl(9, 91%, 26%); }
.category.platform { border: 1px solid hsl(256, 91%, 26%); background: hsl(256, 91%, 26%); }
.category.string-manipulation { border: 1px solid hsl(16, 82%, 26%); background: hsl(16, 82%, 26%); }
.category.timing { border: 1px solid hsl(228, 94%, 26%); background: hsl(228, 94%, 26%); }
.category.performance { border: 1px solid hsl(38, 93%, 26%); background: hsl(38, 93%, 26%); }
.category.number-systems { border: 1px solid hsl(246, 86%, 26%); background: hsl(246, 86%, 26%); }
.category.formula { border: 1px solid hsl(55, 81%, 26%); background: hsl(55, 81%, 26%); }
.category.linear-algebra { border: 1px solid hsl(60, 76%, 26%); background: hsl(60, 76%, 26%); }

View File

@ -206,7 +206,9 @@ CopyStringToBuffer(buffer *Dest, char *Format, ...)
{
if(Length + (Dest->Ptr - Dest->Location) >= Dest->Size)
{
fprintf(stderr, "CopyStringToBuffer: %s cannot accommodate %d-character string\n", Dest->ID, Length);
fprintf(stderr, "CopyStringToBuffer: %s cannot accommodate %d-character string:\n"
"\n"
"%.*s\n", Dest->ID, Length, Length, Format);
__asm__("int3");
}
}
@ -1258,6 +1260,13 @@ main(int ArgC, char **Args)
if(HMML.well_formed)
{
#if DEBUG
printf(
"================================================================================\n"
"%s\n"
"================================================================================\n",
Args[FileIndex]);
#endif
// NOTE(matt): Tree structure of "global" buffer dependencies
// Master
// Includes
@ -1277,7 +1286,7 @@ main(int ArgC, char **Args)
ClaimBuffer(MemoryArena, &ClaimedMemory, &Master, "Master", Kilobytes(512));
ClaimBuffer(MemoryArena, &ClaimedMemory, &Includes, "Includes", Kilobytes(1));
ClaimBuffer(MemoryArena, &ClaimedMemory, &Menus, "Menus", Kilobytes(16));
ClaimBuffer(MemoryArena, &ClaimedMemory, &Menus, "Menus", Kilobytes(24));
ClaimBuffer(MemoryArena, &ClaimedMemory, &QuoteMenu, "QuoteMenu", Kilobytes(16));
ClaimBuffer(MemoryArena, &ClaimedMemory, &ReferenceMenu, "ReferenceMenu", Kilobytes(16));
ClaimBuffer(MemoryArena, &ClaimedMemory, &FilterMenu, "FilterMenu", Kilobytes(16));
@ -1322,7 +1331,17 @@ main(int ArgC, char **Args)
" <div class=\"markers_container %s\">\n", HMML.metadata.id, HMML.metadata.project);
// TODO(matt): Handle multiple annotators
BuildCredits(&CreditsMenu, &HostInfo, &AnnotatorInfo, &HasCreditsMenu, HMML.metadata.member, HMML.metadata.annotators[0]);
if(HMML.metadata.annotator_count > 0)
{
BuildCredits(&CreditsMenu, &HostInfo, &AnnotatorInfo, &HasCreditsMenu, HMML.metadata.member, HMML.metadata.annotators[0]);
}
else
{
fprintf(stderr, "%s: Missing annotator in [video] node\n", Args[FileIndex]);
hmml_free(&HMML);
free(MemoryArena);
return 1;
}
#if DEBUG
printf(" --- Entering Annotations Loop ---\n");