this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Revert "we got something with asan also update sdl-gpus glew is neccessary"

This reverts commit 0dd968866322ea752ebcc9b0132904ccbc0409e5.

alice 6c5e0ea9 3bcf342b

+57 -122
+57 -118
src/studio/screens/console.c
··· 287 287 char* replaced1 = str_replace(text, "$LANG_NAMES$", langnames); 288 288 char* replaced2 = str_replace(replaced1, "$LANG_EXTENSIONS$", langextensions); 289 289 char* replaced3 = str_replace(replaced2, "$LANG_NAMES_PIPE$", langnamespipe); 290 - 291 - // alice was here 292 - // free(replaced2); 293 - // free(replaced1); 290 + free(replaced2); 291 + free(replaced1); 294 292 return replaced3; 295 293 } 296 294 ··· 585 583 586 584 clearSelection(console); 587 585 588 - // alice was here 589 - // FREE(console->desc->src); 590 - // FREE(console->desc->command); 591 - // FREE(console->desc->params); 586 + FREE(console->desc->src); 587 + FREE(console->desc->command); 588 + FREE(console->desc->params); 592 589 593 590 memset(console->desc, 0, sizeof(CommandDesc)); 594 591 } ··· 823 820 printFront(console, console->rom.name); 824 821 printBack(console, " loaded!\n"); 825 822 826 - // alice was here 827 - // free(data); 823 + free(data); 828 824 } 829 825 830 826 static void onCartLoaded(Console* console, const char* name, const char* section) ··· 899 895 if (loadByHashData->callback) 900 896 loadByHashData->callback(loadByHashData->calldata); 901 897 902 - // alice was here 903 - // FREE(loadByHashData->name); 904 - // FREE(loadByHashData->section); 905 - // FREE(loadByHashData); 898 + FREE(loadByHashData->name); 899 + FREE(loadByHashData->section); 900 + FREE(loadByHashData); 906 901 907 902 commandDone(console); 908 903 } ··· 1333 1328 *tmpCommonPrefix = 0; 1334 1329 } 1335 1330 1336 - // Calculate remaining buffer space 1337 - size_t currentLength = strlen(data->options); 1338 - size_t availableSpace = CONSOLE_BUFFER_SCREEN - currentLength - 1; // -1 for null terminator 1339 - 1340 - if (strlen(option) + 1 > availableSpace) { // +1 for the space character 1341 - printf("ASAN Error: Not enough buffer space to add option: %s\n", option); 1342 - return; // Early return to prevent buffer overflow 1343 - } 1344 - 1345 - // Debugging information 1346 - printf("ASAN Buffer space before adding: %zu\n", availableSpace); 1347 - 1348 1331 // The option matches the incomplete word, add it to the list. 1349 - strncat(data->options, option, availableSpace); 1350 - strncat(data->options, " ", availableSpace - strlen(option)); 1351 - 1352 - // Debugging information 1353 - printf("ASAN Option added successfully: %s\n", option); 1354 - 1355 - // The option matches the incomplete word, add it to the list. 1356 - // alice was here 1357 - // ASAN TELLS ME THIS IS THE ISSUE 1358 - // strncat(data->options, option, CONSOLE_BUFFER_SCREEN); 1359 - // strncat(data->options, " ", CONSOLE_BUFFER_SCREEN); 1332 + strncat(data->options, option, CONSOLE_BUFFER_SCREEN); 1333 + strncat(data->options, " ", CONSOLE_BUFFER_SCREEN); 1360 1334 } 1361 1335 } 1362 1336 ··· 1483 1457 finishTabComplete(tabCompleteData); 1484 1458 1485 1459 // Free the pointers here 1486 - // alice was here 1487 - // free(tabCompleteData->options); 1488 - // free(tabCompleteData->commonPrefix); 1460 + free(tabCompleteData->options); 1461 + free(tabCompleteData->commonPrefix); 1489 1462 1490 - // free(tabCompleteData); 1463 + free(tabCompleteData); 1491 1464 } 1492 1465 1493 1466 printf("DATA WAS NOT NULL IN FINISHTABCOMPLETEDATA\n"); ··· 1627 1600 } 1628 1601 else printFront(console, item->name); 1629 1602 1630 - // alice was here 1631 - // free((void*)item->name); 1603 + free((void*)item->name); 1632 1604 } 1633 1605 1634 1606 if (data->count == 0) ··· 1637 1609 printFront(console, "DEMO"); 1638 1610 printBack(console, " command to install demo carts"); 1639 1611 } 1640 - 1641 - // alice was here 1642 - // else free(data->items); 1612 + else free(data->items); 1643 1613 1644 1614 printLine(console); 1645 1615 commandDone(console); 1646 1616 1647 - // alice was here 1648 - // free(ctx); 1617 + free(ctx); 1649 1618 } 1650 1619 1651 1620 typedef struct ··· 1665 1634 } 1666 1635 else printBack(console, "\ndir doesn't exist"); 1667 1636 1668 - // alice was here 1669 - // free(changeDirData->name); 1670 - // free(changeDirData); 1637 + free(changeDirData->name); 1638 + free(changeDirData); 1671 1639 1672 1640 commandDone(console); 1673 1641 } ··· 2323 2291 case net_get_error: 2324 2292 printError(console, "file downloading error :("); 2325 2293 commandDone(console); 2326 - 2327 - // alice was here 2328 - // free(exportData); 2294 + free(exportData); 2329 2295 break; 2330 2296 default: 2331 2297 break; ··· 2345 2311 2346 2312 char filename[TICNAME_MAX]; 2347 2313 strcpy(filename, exportData->filename); 2348 - // alice was here 2349 - // free(exportData); 2314 + free(exportData); 2350 2315 2351 2316 s32 size = data->done.size; 2352 2317 ··· 2357 2322 2358 2323 onFileExported(console, filename, (buf = embedCart(console, data->done.data, &size)) && fs_write(path, buf, size)); 2359 2324 chmod(path, DEFAULT_CHMOD); 2360 - 2361 - // alice was here 2362 - // if (buf) 2363 - // free(buf); 2325 + 2326 + if (buf) 2327 + free(buf); 2364 2328 } 2365 2329 break; 2366 2330 default: ··· 2404 2368 2405 2369 char filename[TICNAME_MAX]; 2406 2370 strcpy(filename, exportData->filename); 2407 - // alice was here 2408 - // free(exportData); 2371 + free(exportData); 2409 2372 2410 2373 const char* zipPath = tic_fs_path(console->fs, filename); 2411 2374 bool errorOccurred = !fs_write(zipPath, data->done.data, data->done.size); ··· 2682 2645 { 2683 2646 console->config->save(console->config); 2684 2647 studioRomSaved(console->studio); 2685 - // alice was here 2686 - // free(buffer); 2648 + free(buffer); 2687 2649 return CART_SAVE_OK; 2688 2650 } 2689 2651 else ··· 2730 2692 if(title) 2731 2693 { 2732 2694 drawShadowText(tic, title, 0, 0, tic_color_white, Scale); 2733 - // alice was here 2734 - // free(title); 2695 + free(title); 2735 2696 } 2736 2697 2737 2698 char* author = tic_tool_metatag(tic->cart.code.data, "author", comment); ··· 2740 2701 char buf[TICNAME_MAX]; 2741 2702 snprintf(buf, sizeof buf, "by %s", author); 2742 2703 drawShadowText(tic, buf, 0, Row, tic_color_grey, Scale); 2743 - // alice was here 2744 - // free(author); 2704 + free(author); 2745 2705 } 2746 2706 2747 2707 u32* ptr = img.values + PaddingTop * CoverWidth + PaddingLeft; ··· 2755 2715 2756 2716 cover = png_write(img, (png_buffer){NULL, 0}); 2757 2717 2758 - // alice was here 2759 - // free(img.data); 2718 + free(img.data); 2760 2719 } 2761 2720 2762 2721 png_buffer zip = png_create(sizeof(tic_cartridge)); ··· 2765 2724 png_buffer cart = png_create(sizeof(tic_cartridge)); 2766 2725 cart.size = tic_cart_save(&tic->cart, cart.data); 2767 2726 zip.size = tic_tool_zip(zip.data, zip.size, cart.data, cart.size); 2768 - // alice was here 2769 - // free(cart.data); 2727 + free(cart.data); 2770 2728 } 2771 2729 2772 2730 png_buffer result = png_encode(cover, zip); 2773 - // alice was here 2774 - // free(zip.data); 2775 - // free(cover.data); 2731 + free(zip.data); 2732 + free(cover.data); 2776 2733 2777 2734 buffer = result.data; 2778 2735 size = result.size; ··· 2797 2754 } 2798 2755 } 2799 2756 2800 - // alice was here 2801 - // free(buffer); 2757 + free(buffer); 2802 2758 } 2803 2759 } 2804 2760 else if (strlen(console->rom.name)) ··· 3578 3534 3579 3535 TabCompleteData newTabCompleteData(Console* console, char* incompleteWord) { 3580 3536 TabCompleteData data = { console, .incompleteWord = incompleteWord }; 3581 - printf("BEFORE MALLOC1 IN newTabCompleteData\n"); 3582 3537 data.options = malloc(CONSOLE_BUFFER_SCREEN); 3583 - printf("BEFORE MALLOC2 IN newTabCompleteData\n"); 3584 3538 data.commonPrefix = malloc(CONSOLE_BUFFER_SCREEN); 3585 3539 3586 3540 // Check for malloc failure ··· 3588 3542 printf("OOPSIE WHOOPSIE WE MADE A FUCKSIE WUCKSIE\n"); 3589 3543 // Handle error, for example, by logging and exiting or by setting a default value 3590 3544 // For simplicity, we'll just free any successful allocation and return an empty struct 3591 - // alice was here 3592 - // free(data.options); // Safe to call free on NULL 3593 - // free(data.commonPrefix); 3545 + free(data.options); // Safe to call free on NULL 3546 + free(data.commonPrefix); 3594 3547 return (TabCompleteData){0}; // Return an empty struct or handle error appropriately 3595 3548 } 3596 3549 ··· 3688 3641 TabCompleteData data = newTabCompleteData(console, param); 3689 3642 printf("TabCompleteData data is: %p\n", (void*)&data); 3690 3643 Commands[i].tabComplete1(&data); 3691 - // alice added 3692 - break; 3693 3644 } 3694 3645 } 3695 3646 } ··· 3713 3664 finishTabComplete(&data); 3714 3665 printf("Finished tab completion\n"); 3715 3666 } 3716 - // printf("Scrolling console FROM processConsoleTab\n"); 3717 - // scrollConsole(console); 3667 + printf("Scrolling console\n"); 3668 + scrollConsole(console); 3718 3669 } 3719 3670 3720 3671 static void toUpperStr(char* str) ··· 3735 3686 consolePrint(console, "\n---=== COMMAND ===---\n", tic_color_green); 3736 3687 char* helpReplaced = replaceHelpTokens(cmd->help); 3737 3688 printBack(console, helpReplaced); 3738 - // alice was here 3739 - // free(helpReplaced); 3689 + free(helpReplaced); 3740 3690 3741 3691 if(cmd->usage) 3742 3692 { 3743 3693 printFront(console, "\n\nusage: "); 3744 3694 char* usageReplaced = replaceHelpTokens(cmd->usage); 3745 3695 printBack(console, usageReplaced); 3746 - // alice was here 3747 - // free(usageReplaced); 3696 + free(usageReplaced); 3748 3697 } 3749 3698 3750 3699 printLine(console); ··· 3895 3844 char* rowReplaced = replaceHelpTokens(row->info); 3896 3845 sprintf(buf, "%-" DEF2STR(OFFSET) "s%s\n", row->section, rowReplaced); 3897 3846 consolePrintOffset(console, buf, tic_color_grey, OFFSET); 3898 - // alice was here 3899 - // free(rowReplaced); 3847 + free(rowReplaced); 3900 3848 #undef OFFSET 3901 3849 } 3902 3850 } ··· 4133 4081 { 4134 4082 if(luaL_loadstring(lua, (char*)script) == LUA_OK && lua_pcall(lua, 0, LUA_MULTRET, 0) == LUA_OK) 4135 4083 { 4136 - // alice was here 4137 - // free(script); 4084 + free(script); 4138 4085 return lua; 4139 4086 } 4140 4087 else lua_close(lua); 4141 4088 } 4142 4089 4143 - // alice was here 4144 - // free(script); 4090 + free(script); 4145 4091 } 4146 4092 4147 4093 return NULL; ··· 4255 4201 if (text) 4256 4202 { 4257 4203 tic_sys_clipboard_set(text); 4258 - // alice was here 4259 - // free(text); 4204 + free(text); 4260 4205 clearSelection(console); 4261 4206 } 4262 4207 } ··· 4277 4222 *dst++ = *src; 4278 4223 4279 4224 insertInputText(console, text); 4280 - 4281 - // alice was here 4282 - // free(text); 4225 + free(text); 4283 4226 4284 4227 tic_sys_clipboard_free(clipboard); 4285 4228 } ··· 4352 4295 { 4353 4296 insertInputText(console, text); 4354 4297 tic_sys_clipboard_set(text); 4355 - // alice was here 4356 - // free(text); 4298 + free(text); 4357 4299 } 4358 4300 else 4359 4301 copyFromClipboard(console); ··· 4636 4578 if(cart) 4637 4579 { 4638 4580 memcpy(&tic->cart, cart, sizeof(tic_cartridge)); 4639 - // alice was here 4640 - // free(cart); 4581 + free(cart); 4641 4582 done = true; 4642 4583 } 4643 4584 } ··· 4785 4726 4786 4727 void freeConsole(Console* console) 4787 4728 { 4788 - return; 4789 - // alice was here 4790 - // free(console->text); 4791 - // free(console->color); 4729 + free(console->text); 4730 + free(console->color); 4792 4731 4793 - // if(console->history.items) 4794 - // { 4795 - // for(char **ptr = console->history.items, **end = ptr + console->history.size; ptr < end; ptr++) 4796 - // free(*ptr); 4732 + if(console->history.items) 4733 + { 4734 + for(char **ptr = console->history.items, **end = ptr + console->history.size; ptr < end; ptr++) 4735 + free(*ptr); 4797 4736 4798 - // free(console->history.items); 4799 - // } 4737 + free(console->history.items); 4738 + } 4800 4739 4801 - // FREE(console->commands.items); 4802 - // free(console->desc); 4803 - // free(console); 4740 + FREE(console->commands.items); 4741 + free(console->desc); 4742 + free(console); 4804 4743 }
-4
src/studio/screens/start.c
··· 30 30 #include <unistd.h> 31 31 #endif 32 32 33 - #if defined(__APPLE__) 34 - #include <mach-o/dyld.h> 35 - #endif 36 - 37 33 static void reset(Start* start) 38 34 { 39 35 u8* tile = (u8*)start->tic->ram->tiles.data;