Skip to content

Commit 52c0aca

Browse files
author
ig-14
committed
Merge remote-tracking branch 'origin/main' into fix-video-rotation-90deg
2 parents cece01d + 4016909 commit 52c0aca

File tree

146 files changed

+5398
-1565
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+5398
-1565
lines changed

.github/workflows/tabs.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Check for Tabs
2+
on: [push, pull_request]
3+
4+
jobs:
5+
no-tabs:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout code
9+
uses: actions/checkout@v4
10+
11+
- name: Fail if tabs are found in source files
12+
# Exclude specific file types if necessary (e.g., binaries, .md files, etc.)
13+
run: |
14+
# Define folders to check
15+
FOLDERS=("Common" "SerialPrograms")
16+
17+
# Define file extensions to check
18+
EXTENSIONS=("h" "c" "cpp" "tpp")
19+
20+
echo "Searching for Git-tracked files with tabs..."
21+
echo "Folders: ${FOLDERS[@]}"
22+
echo "Extensions: ${EXTENSIONS[@]}"
23+
echo ""
24+
25+
# Build git ls-files patterns
26+
PATTERNS=()
27+
for folder in "${FOLDERS[@]}"; do
28+
for ext in "${EXTENSIONS[@]}"; do
29+
PATTERNS+=("$folder/**/*.$ext")
30+
done
31+
done
32+
33+
# Get all matching Git-tracked files
34+
ALL_FILES=$(git ls-files "${PATTERNS[@]}" 2>/dev/null | sort -u)
35+
36+
if [ -z "$ALL_FILES" ]; then
37+
echo "No Git-tracked source files found to check"
38+
exit 0
39+
fi
40+
41+
echo "Found $(echo "$ALL_FILES" | wc -l) files to check"
42+
echo ""
43+
44+
# Check each file for tabs
45+
FILES_WITH_TABS=""
46+
while IFS= read -r file; do
47+
if [ -f "$file" ] && grep -q $'\t' "$file" 2>/dev/null; then
48+
FILES_WITH_TABS+="$file"$'\n'
49+
fi
50+
done <<< "$ALL_FILES"
51+
52+
# Check results and print
53+
if [ -n "$FILES_WITH_TABS" ]; then
54+
echo "::error::The following files contain tabs:"
55+
echo ""
56+
echo "$FILES_WITH_TABS" | while IFS= read -r file; do
57+
if [ -n "$file" ]; then
58+
echo " $file"
59+
echo "::error file=$file::File contains tabs"
60+
fi
61+
done
62+
echo ""
63+
echo "Please replace tabs with spaces in the files listed above."
64+
exit 1
65+
else
66+
echo "✓ No tabs found in any Git-tracked source files"
67+
fi

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ __pycache__
6161
# Jupyter Notebooks
6262
*.ipynb
6363

64-
64+
CLAUDE.md

3rdPartyBinaries/onnxruntime.dll

4.56 MB
Binary file not shown.

3rdPartyBinaries/onnxruntime.lib

710 Bytes
Binary file not shown.
-16 Bytes
Binary file not shown.

Common/Cpp/Json/JsonObject.cpp

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,27 +171,24 @@ JsonValue* JsonObject::get_value(const std::string& key){
171171

172172

173173

174-
#if 0
175-
176174
// Read with defaults.
177175

178-
bool JsonObject::to_boolean(const std::string& key, bool default_value) const{
176+
bool JsonObject::get_boolean_default(const std::string& key, bool default_value) const{
179177
read_boolean(default_value, key);
180178
return default_value;
181179
}
182-
int64_t JsonObject::to_integer(const std::string& key, int64_t default_value) const{
180+
int64_t JsonObject::get_integer_default(const std::string& key, int64_t default_value) const{
183181
read_integer(default_value, key);
184182
return default_value;
185183
}
186-
double JsonObject::to_double(const std::string& key, double default_value) const{
184+
double JsonObject::get_double_default(const std::string& key, double default_value) const{
187185
read_float(default_value, key);
188186
return default_value;
189187
}
190-
std::string JsonObject::to_string(const std::string& key, const char* default_value) const{
188+
std::string JsonObject::get_string_default(const std::string& key, const char* default_value) const{
191189
const std::string* str = get_string(key);
192190
return str == nullptr ? default_value : *str;
193191
}
194-
#endif
195192

196193

197194

Common/Cpp/Json/JsonObject.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,11 @@ class JsonObject{
6969
const JsonValue* get_value (const std::string& key) const;
7070
JsonValue* get_value (const std::string& key);
7171

72-
#if 0
7372
// Convert to the specified type. If the type doesn't match, return the default.
74-
bool to_boolean (const std::string& key, bool default_value = false) const;
75-
int64_t to_integer (const std::string& key, int64_t default_value = 0) const;
76-
double to_double (const std::string& key, double default_value = 0) const;
77-
std::string to_string (const std::string& key, const char* default_value = "") const;
78-
#endif
73+
bool get_boolean_default (const std::string& key, bool default_value = false) const;
74+
int64_t get_integer_default (const std::string& key, int64_t default_value = 0) const;
75+
double get_double_default (const std::string& key, double default_value = 0) const;
76+
std::string get_string_default (const std::string& key, const char* default_value = "") const;
7977

8078
// Attempt to read this value at the specified key.
8179
// If the key exists and the type matches, the value is assigned to "value" and returns true.

Common/Cpp/MemoryUtilization/MemoryUtilization_Windows.tpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,11 @@ MemoryUsage process_memory_usage(){
3232
(PROCESS_MEMORY_COUNTERS*)&data,
3333
sizeof(data)
3434
)){
35-
ret.process_physical_memory = data.PrivateWorkingSetSize;
35+
if (data.cb >= sizeof(PROCESS_MEMORY_COUNTERS_EX2)){
36+
ret.process_physical_memory = data.PrivateWorkingSetSize;
37+
}else{
38+
ret.process_physical_memory = data.WorkingSetSize;
39+
}
3640
ret.process_virtual_memory = data.PagefileUsage;
3741
}
3842
}

Common/Cpp/Options/ConfigOption.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,6 @@ class ConfigOption{
7777
ConfigOption(LockMode lock_mode);
7878
ConfigOption(ConfigOptionState visibility);
7979

80-
// // Deep copy this entire config. This will not copy listeners.
81-
// // Returns null if config cannot be copied.
82-
// virtual std::unique_ptr<ConfigOption> clone() const = 0;
83-
8480
virtual void load_json(const JsonValue& json);
8581
virtual JsonValue to_json() const;
8682

Common/Cpp/PanicDump.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ void panic_dump(const char* location, const char* message){
3232

3333

3434
void run_with_catch(const char* location, std::function<void()>&& lambda){
35-
#if 1
35+
#ifdef _WIN32
3636
lambda();
3737
#else
3838
try{
@@ -59,3 +59,4 @@ void run_with_catch(const char* location, std::function<void()>&& lambda){
5959

6060

6161
}
62+

0 commit comments

Comments
 (0)