Skip to content
Snippets Groups Projects
Select Git revision
  • 5c16a91fd63ddfe1af0c3d8a723cc36828d2e8ec
  • next default protected
  • personal-amalgamate
  • ogl-palette-update
  • rphys-update
  • overlay-fpcam
  • inputviewer-toggle
  • master
  • ogl-pal
  • trace
  • uncapped
  • personal
  • palette
  • shadernmus
  • missing-gcc-flags
  • g_findmap-lua
  • pictureformats
  • sprite-fof-plane-sorting-question-mark
  • opengl-skydome-fixes
  • patch-cache-refactor
  • video-refactor
  • SRB2_release_2.2.6
  • SRB2_release_2.2.5
  • SRB2_release_2.2.4
  • SRB2_release_2.2.3
  • SRB2_release_2.2.2
  • SRB2_release_2.2.1
  • SRB2_release_2.2.0
  • SRB2_release_2.1.25
  • SRB2_release_2.1.24
  • SRB2_release_2.1.23
  • SRB2_release_2.1.22
  • SRB2_release_2.1.21
  • SRB2_release_2.1.20
  • SRB2_release_2.1.19
  • SRB2_release_2.1.18
  • td-release-v1.0.0
  • SRB2_release_2.1.17
  • SRB2_release_2.1.16a
  • SRB2_release_2.1.16
  • SRB2_release_2.1.15
41 results

r_opengl.h

Blame
  • Forked from STJr / SRB2
    Source project has a limited visibility.
    fastcmp.h 790 B
    #ifndef __FASTCMP_H__
    #define __FASTCMP_H__
    
    // returns false if s != c
    // returns true if s == c
    FUNCINLINE static ATTRINLINE boolean fasticmp(const char *s, const char *c)
    {
    	for (; *s && toupper(*s) == toupper(*c); s++, c++) ;
    	return (*s == *c); // make sure both strings ended
    }
    
    // case-sensitive of the above
    FUNCINLINE static ATTRINLINE boolean fastcmp(const char *s, const char *c)
    {
    	for (; *s && *s == *c; s++, c++) ;
    	return (*s == *c); // make sure both strings ended
    }
    
    // length-limited of the above
    // only true if both strings are at least l characters long AND match, case-sensitively!
    FUNCINLINE static ATTRINLINE boolean fastncmp(const char *s, const char *c, UINT16 l)
    {
    	for (; *s && *s == *c && --l; s++, c++) ;
    	return !l; // make sure you reached the end
    }
    
    #endif