Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler errors on more recent compilers. #6

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open

Fix compiler errors on more recent compilers. #6

wants to merge 10 commits into from

Commits on May 30, 2018

  1. tr_shader.cpp: fix errors on GCC8

    GCC8 refuses to compile this file because of implicit truncation between
    integer variables and constants. Extend the size of the in-memory table to fix the issue.
    
    Signed-off-by: Francesco Giancane <[email protected]>
    fgiancane8 committed May 30, 2018
    Configuration menu
    Copy the full SHA
    de4789d View commit details
    Browse the repository at this point in the history
  2. BlockStream.cpp: fix errors under GCC8

    GCC8 refuses to compile this file because of (wrong) implicit
    conversion between boolean and pointers.
    This was based on the (now wrong) implicit assumption that false
    would convert to NULL.
    
    Signed-off-by: Francesco Giancane <[email protected]>
    fgiancane8 committed May 30, 2018
    Configuration menu
    Copy the full SHA
    27e34aa View commit details
    Browse the repository at this point in the history
  3. Resolve ambiguities between std::move and move static variable

    Some files used for AI for some kind of actors use a static variable
    called 'move'.
    
    Using recently enough compilers, an ambiguity between the aforementioned
    names would apply.
    
    Fix the issue by renaming the global variable.
    
    Signed-off-by: Francesco Giancane <[email protected]>
    fgiancane8 committed May 30, 2018
    Configuration menu
    Copy the full SHA
    dfa4bc5 View commit details
    Browse the repository at this point in the history
  4. Fix ambiguities between std::forward and forward

    The source file g_weapon.cpp contains a variable called 'forward'
    which may be evaluated as a reference for std::forward function.
    
    Renaming the global variable will fix the ambiguity on more recent compilers.
    
    Signed-off-by: Francesco Giancane <[email protected]>
    fgiancane8 committed May 30, 2018
    Configuration menu
    Copy the full SHA
    b89da87 View commit details
    Browse the repository at this point in the history
  5. bg_lib.cpp: remove useless file

    This file contains an implementation of some math functions
    that can be now found on modern compilers and environment.
    
    This can be safely emptied (and then removed when removed from CMakeLists.txt).
    
    Signed-off-by: Francesco Giancane <[email protected]>
    fgiancane8 committed May 30, 2018
    Configuration menu
    Copy the full SHA
    0c8ffb4 View commit details
    Browse the repository at this point in the history
  6. bg_pmove.cpp: explicitly convert parameter

    Adding a static_cast<> to ensure that integral values are correctly promoted to vec3_t.
    
    Signed-off-by: Francesco Giancane <[email protected]>
    fgiancane8 committed May 30, 2018
    Configuration menu
    Copy the full SHA
    8b34b75 View commit details
    Browse the repository at this point in the history
  7. fields.h: properly size the field

    field was wrongly typed as int, but in reality it should store a size_t.
    
    This fixes compilation issues on platforms where sizeof(int) != sizeof(size_t).
    
    Signed-off-by: Francesco Giancane <[email protected]>
    fgiancane8 committed May 30, 2018
    Configuration menu
    Copy the full SHA
    d6bac2c View commit details
    Browse the repository at this point in the history
  8. common.cpp: rewrite code in order to properly compile

    Preprocessed string concatenation was abused in this context.
    
    More recent compilers would just reject that syntax and refuse to compile.
    Rewrite the code so that same output is produced but no error is generated.
    
    Signed-off-by: Francesco Giancane <[email protected]>
    fgiancane8 committed May 30, 2018
    Configuration menu
    Copy the full SHA
    e62d1ab View commit details
    Browse the repository at this point in the history
  9. Fix compiler erros on struct size definitions.

    On some platforms, where sizeof(int) != sizeof(size_t), the struct
    could not accomodate all the data.
    Fix the issue by retyping the flags correctly.
    
    Signed-off-by: Francesco Giancane <[email protected]>
    fgiancane8 committed May 30, 2018
    Configuration menu
    Copy the full SHA
    dfb5ee4 View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2018

  1. tr_shader.cpp: amend previous commit for x86

    With the last modification in the structure, the building failure was fixed just for x86_64 machines.
    Promoting long int to long long (int) fixes the failure for both x86 and x86_64 machines.
    
    Tested with Clang and GCC 8.
    
    Signed-off-by: Francesco Giancane <[email protected]>
    fgiancane8 committed Jun 1, 2018
    Configuration menu
    Copy the full SHA
    160e009 View commit details
    Browse the repository at this point in the history