Some ci attempt + fix kv

This commit is contained in:
Kenzzer 2025-10-26 19:03:40 +00:00
parent 65219f131f
commit 693108529e
No known key found for this signature in database
GPG Key ID: 64C3FD4332686DC1
2 changed files with 89 additions and 9 deletions

86
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,86 @@
name: Compilation
on:
push:
pull_request:
jobs:
build:
strategy:
matrix:
os: [ubuntu-22.04, windows-2022]
include:
- os: ubuntu-22.04
cc: clang
cxx: clang++
- os: windows-2022
cc: msvc
fail-fast: false
name: ${{ matrix.os }} - ${{ matrix.cc }}
runs-on: ${{ matrix.os }}
steps:
- name: Linux dependencies
if: startsWith(runner.os, 'Linux')
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
gcc-multilib g++-multilib libstdc++6 lib32stdc++6 \
libc6-dev libc6-dev-i386 linux-libc-dev \
linux-libc-dev:i386 lib32z1-dev ${{ matrix.cc }}
- uses: actions/setup-python@v5
name: Setup Python 3.12
with:
python-version: 3.12
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
- uses: actions/checkout@v4
name: Repository checkout
with:
fetch-depth: 0
submodules: recursive
path: repository
- uses: actions/checkout@v4
name: AMBuild checkout
with:
repository: alliedmodders/ambuild
ref: fe8c99ccd24fa926bf6ac6b9935a5fc03df06a72
fetch-depth: 0
submodules: recursive
path: ambuild
- name: Setup AMBuild
shell: bash
run: |
cd "${{ env.CACHE_PATH }}"
python -m pip install ./ambuild
- name: Select clang compiler
if: startsWith(runner.os, 'Linux')
run: |
echo "CC=${{ matrix.cc }}" >> $GITHUB_ENV
echo "CXX=${{ matrix.cxx }}" >> $GITHUB_ENV
${{ matrix.cc }} --version
${{ matrix.cxx }} --version
- name: Build
shell: bash
working-directory: repository
run: |
mkdir build
cd build
python ../configure.py
ambuild
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: libs_${{ runner.os }}
path: repository/build/lib

View File

@ -22,6 +22,7 @@
#include "tier0/vprof_telemetry.h"
#include <Color.h>
#include <stdlib.h>
#include <cstdlib>
#include "tier0/dbg.h"
#include "tier0/mem.h"
#include "utlbuffer.h"
@ -1385,14 +1386,7 @@ float KeyValues::GetFloat( const char *keyName, float defaultValue )
switch ( dat->m_iDataType )
{
case TYPE_STRING:
return (float)atof(dat->m_sValue);
case TYPE_WSTRING:
#ifdef WIN32
return (float) _wtof(dat->m_wsValue); // no wtof
#else
Assert( !"impl me" );
return 0.0;
#endif
return std::strtof(dat->m_sValue, nullptr);
case TYPE_FLOAT:
return dat->m_flValue;
case TYPE_INT: