<commit_before>// Copyright (C) 2017 <NAME>
// This file is part of the Ouzel engine.

#include <cstdlib>
#include <emscripten.h>
#include "ApplicationEm.h"
#include "core/Engine.h"
#include "utils/Utils.h"

static void loop(void)
{
    if (!static_cast<ouzel::ApplicationEm*>(ouzel::sharedApplication)->step())
    {
        emscripten_cancel_main_loop();
    }
}

namespace ouzel
{
    ApplicationEm::ApplicationEm(int aArgc, char* aArgv[]):
        Application(aArgc, aArgv)
    {
    }

    int ApplicationEm::run()
    {
        ouzelMain(args);

        if (!sharedEngine)
        {
            return EXIT_FAILURE;
        }

        emscripten_set_main_loop(loop, 0, 1);

        exit();

        if (ouzel::sharedEngine)
        {
            ouzel::sharedEngine->stop();
        }

        return EXIT_SUCCESS;
    }

    bool ApplicationEm::step()
    {
        executeAll();
        sharedEngine->update();
        sharedEngine->getAudio->update();

        if (!sharedEngine->draw())
        {
            return false;
        }

        return active;
    }

    bool ApplicationEm::openURL(const std::string& url)
    {
        EM_ASM_ARGS({window.open(Pointer_stringify($0));}, url.c_str());

        return true;
    }
}<commit_msg>Fix Emscripten build<commit_after>// Copyright (C) 2017 <NAME>
// This file is part of the Ouzel engine.

#include <cstdlib>
#include <emscripten.h>
#include "ApplicationEm.h"
#include "core/Engine.h"
#include "utils/Utils.h"

static void loop(void)
{
    if (!static_cast<ouzel::ApplicationEm*>(ouzel::sharedApplication)->step())
    {
        emscripten_cancel_main_loop();
    }
}

namespace ouzel
{
    ApplicationEm::ApplicationEm(int aArgc, char* aArgv[]):
        Application(aArgc, aArgv)
    {
    }

    int ApplicationEm::run()
    {
        ouzelMain(args);

        if (!sharedEngine)
        {
            return EXIT_FAILURE;
        }

        emscripten_set_main_loop(loop, 0, 1);

        exit();

        if (ouzel::sharedEngine)
        {
            ouzel::sharedEngine->stop();
        }

        return EXIT_SUCCESS;
    }

    bool ApplicationEm::step()
    {
        executeAll();
        sharedEngine->update();
        sharedEngine->getAudio()->update();

        if (!sharedEngine->draw())
        {
            return false;
        }

        return active;
    }

    bool ApplicationEm::openURL(const std::string& url)
    {
        EM_ASM_ARGS({window.open(Pointer_stringify($0));}, url.c_str());

        return true;
    }
}
{'fraction_non_alphanumeric': 0.13551215623754484, 'fraction_numerical': 0.005579912315663611, 'mean_word_length': 2.2138284250960307, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 23, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1353912', 'n_tokens_mistral': 819, 'n_tokens_neox': 784, 'n_words': 146}