GithubHelp home page GithubHelp logo

hilolay's People

Contributors

afilgueira avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

hilolay's Issues

VM Cátedra: ‘for’ loop initial declarations are only allowed in C99 mode

Así como está y según las instrucciones del repo, no compila en la VM de Lubuntu de la cátedra (la que tiene GUI).
Error: declaración de una variable dentro de la condición del for (Sólo se permite en C99)

ults.c: In function ‘test’:
ults.c:5:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for (int i = 0; i < 20; i++) {
     ^
ults.c:5:5: note: use option -std=c99 or -std=gnu99 to compile your code
ults.c: In function ‘main’:
ults.c:18:5: error: ‘for’ loop initial declarations are only allowed in C99 mode
     for(int i=0; i < 5; i++) {
     ^

Improve the for loop

https://github.com/afilgueira/ults/blob/3fb87b6887ad80c554931dddae49ef326ebc040c/hilolay/hilolay.c#L91-L98

Alternatives:

    for (new_ult = &ults[0];new_ult->state != FREE; new_ult++) {
        if (new_ult == &ults[MAX_ULTS]) {
            lib_log("Cannot create a new ULTs!");
            return ERROR_TOO_MANY_ULTS;
        }
    }
    for (new_ult = &ults[0]; new_ult != &ults[MAX_ULTS] && new_ult->state != FREE; new_ult++);
    if (new_ult == &ults[MAX_ULTS]) {
        lib_log("Cannot create a new ULTs!");
        return ERROR_TOO_MANY_ULTS;
    }
    new_ult = &ults[0];
    while (new_ult != &ults[MAX_ULTS] && new_ult->state != FREE){
       new_ult++;
    }
    if (new_ult == &ults[MAX_ULTS]) {
        lib_log("Cannot create a new ULTs!");
        return ERROR_TOO_MANY_ULTS;
    }

Configurar biblioteca

La funcion de init deberia permitir elegir el algoritmo y alguna cosa mas de configuracion

Codear wrappers para las E/S

Que hagan yield al finalizarlas. Me gustaria tener una funcion generica, que reciba otra funcion por parametro, y de ahi descomponer en un set de 8-10 funciones "nuestras" que la usen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.