Skip to content

Commit

Permalink
Merge branch 'v3.008-dev-new' into v3.007-dev-new-itemshistory-fixes.…
Browse files Browse the repository at this point in the history
… After fixing errors and before clang-format.
  • Loading branch information
nseam committed Jun 26, 2024
2 parents 6a38ad3 + 6859c3a commit 2911097
Show file tree
Hide file tree
Showing 167 changed files with 5,129 additions and 2,433 deletions.
108 changes: 108 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
Checks: |-
*,
-altera-id-dependent-backward-branch,
-altera-struct-pack-align,
-altera-unroll-loops,
-bugprone-branch-clone,
-bugprone-copy-constructor-init,
-bugprone-easily-swappable-parameters,
-bugprone-integer-division,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-redundant-branch-condition,
-bugprone-reserved-identifier,
-bugprone-string-constructor,
-bugprone-unhandled-self-assignment,
-cert-dcl37-c,
-cert-dcl51-cpp,
-cert-msc30-c,
-cert-msc50-cpp,
-cert-oop54-cpp,
-cert-oop54-cpp,
-clang-diagnostic-error,
-concurrency-mt-unsafe,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-avoid-non-const-global-variables,
-cppcoreguidelines-c-copy-assignment-signature,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-prefer-member-initializer,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-type-member-init,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-special-member-functions,
-fuchsia-default-arguments-calls,
-fuchsia-default-arguments-declarations,
-fuchsia-overloaded-operator,
-fuchsia-trailing-return,
-google-explicit-constructor,
-google-global-names-in-headers,
-google-readability-braces-around-statements,
-google-readability-casting,
-google-runtime-int,
-hicpp-avoid-c-arrays,
-hicpp-braces-around-statements,
-hicpp-braces-around-statements,
-hicpp-exception-baseclass,
-hicpp-explicit-conversions,
-hicpp-member-init,
-hicpp-multiway-paths-covered,
-hicpp-named-parameter,
-hicpp-no-array-decay,
-hicpp-signed-bitwise,,
-hicpp-special-member-functions,
-hicpp-uppercase-literal-suffix,
-hicpp-use-auto,
-hicpp-use-equals-default,
-hicpp-use-nullptr,
-hicpp-vararg,
-llvm-else-after-return,
-llvm-header-guard,,
-llvmlibc-callee-namespace,
-llvmlibc-implementation-in-namespace,,
-llvmlibc-restrict-system-libc-headers,
-misc-definitions-in-headers,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-non-private-member-variables-in-classes,
-misc-unconventional-assign-operator,
-misc-unused-parameters,,
-modernize-avoid-c-arrays,
-modernize-raw-string-literal,
-modernize-redundant-void-arg,
-modernize-use-auto,
-modernize-use-default-member-init,
-modernize-use-equals-default,
-modernize-use-nullptr,
-modernize-use-nullptr,
-modernize-use-trailing-return-type,
-modernize-use-using,
-performance-unnecessary-value-param,
-readability-avoid-const-params-in-decls,
-readability-braces-around-statements,
-readability-braces-around-statements,
-readability-const-return-type,
-readability-container-size-empty,
-readability-convert-member-functions-to-static,
-readability-delete-null-pointer,
-readability-else-after-return,
-readability-identifier-length,
-readability-implicit-bool-conversion,
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-make-member-function-const,
-readability-named-parameter,
-readability-redundant-access-specifiers,
-readability-redundant-declaration,
-readability-redundant-string-init,
-readability-simplify-boolean-expr,
-readability-uppercase-literal-suffix,
FormatStyle: file
HeaderFilterRegex: '.*'
WarningsAsErrors: ''
9 changes: 9 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.238.1/containers/ubuntu/.devcontainer/base.Dockerfile

# [Choice] Ubuntu version (use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon): ubuntu-22.04, ubuntu-20.04, ubuntu-18.04
ARG VARIANT="jammy"
FROM mcr.microsoft.com/vscode/devcontainers/base:0-${VARIANT}

# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>
23 changes: 22 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ubuntu
{

// "build": {
// "dockerfile": "Dockerfile",
// Update 'VARIANT' to pick an Ubuntu version: jammy / ubuntu-22.04, focal / ubuntu-20.04, bionic /ubuntu-18.04
// Use ubuntu-22.04 or ubuntu-18.04 on local arm64/Apple Silicon.
// "args": { "VARIANT": "ubuntu-22.04" }
// },

// Configure tool-specific properties.
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cpptools-extension-pack",
"nicholishen.mql-over-cpp",
"vscodevim.vim",
"DavidAnson.vscode-markdownlint",
"EA31337.vscode-mql-tools"
"EA31337.vscode-mql-tools",
"xaver.clang-format"
],
}
},
Expand All @@ -23,7 +34,17 @@
// "ghcr.io/maks1ms/devcontainers-features/wine:0": {},
"ghcr.io/devcontainers-contrib/features/node-asdf:0": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "uname -a",

// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"name": "EA31337"

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
"remoteUser": "vscode",
}
14 changes: 7 additions & 7 deletions .github/workflows/compile-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
jobs:

FileList:
if: ${{ false }} # @fixme
outputs:
filelist: ${{ steps.get-files.outputs.filelist }}
runs-on: ubuntu-latest
Expand All @@ -30,7 +29,6 @@ jobs:
run: echo ${{ steps.get-files.outputs.filelist }}

Compile:
if: ${{ false }} # @fixme
runs-on: ubuntu-latest
needs: [FileList]
strategy:
Expand All @@ -45,9 +43,11 @@ jobs:
with:
compiler: gcc-latest
- name: Compile ${{ matrix.file }} via emcc
run: emcc "${{ matrix.file }}"
if: always()
run: >
emcc -s WASM=1 -s ENVIRONMENT=node -s EXIT_RUNTIME=0 -s NO_EXIT_RUNTIME=1 -s ASSERTIONS=1 -Wall -s
MODULARIZE=1 -s ERROR_ON_UNDEFINED_SYMBOLS=0 --bind -s EXPORTED_FUNCTIONS="[]" -g -std=c++17
"${{ matrix.file }}"
- name: Compile ${{ matrix.file }} via g++
run: g++ -c "${{ matrix.file }}"
- if: failure()
# Force success.
run: exit 0
if: always()
run: g++ -g -std=c++17 -c "${{ matrix.file }}"
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ jobs:
strategy:
matrix:
test:
- AccountTest
- BufferStructTest
- BufferTest
- ChartTest
Expand All @@ -59,6 +60,7 @@ jobs:
- SummaryReportTest
- TickerTest
- TradeTest
max-parallel: 4
steps:
- uses: actions/download-artifact@v2
with:
Expand All @@ -72,6 +74,7 @@ jobs:
Version: 4
TestExpert: ${{ matrix.test }}
RunOnError: show_logs 200
if: always()
timeout-minutes: 10

Scripts-MQL4:
Expand Down Expand Up @@ -100,6 +103,7 @@ jobs:
- TerminalTest
- TimerTest
- ValueStorageTest
max-parallel: 4
steps:
- uses: actions/download-artifact@v2
with:
Expand All @@ -108,6 +112,7 @@ jobs:
uses: fx31337/mql-tester-action@master
with:
Script: ${{ matrix.test }}
if: always()
timeout-minutes: 10

Scripts-MQL4-Ignore:
Expand All @@ -134,6 +139,7 @@ jobs:
with:
Script: ${{ matrix.test }}
RunOnFail: "exit 0"
if: always()
timeout-minutes: 10

Trade-Tests-MQL4:
Expand All @@ -156,6 +162,7 @@ jobs:
uses: fx31337/mql-tester-action@master
with:
Script: ${{ matrix.test }}
if: always()
timeout-minutes: 10

cleanup:
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
exclude: '\.md$'
repos:

# - repo: https://github.com/pre-commit/mirrors-clang-format
# rev: v14.0.6
# hooks:
# - id: clang-format

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
hooks:
Expand Down
1 change: 1 addition & 0 deletions 3D/Chart3DCandles.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
* 3D chart candles renderer.
*/

#include "../Chart.define.h"
#include "Chart3DType.h"
#include "Cube.h"
#include "Device.h"
Expand Down
5 changes: 5 additions & 0 deletions 3D/Mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,13 @@ struct PointEntry {
T point;
long key;

// Default constructor.
PointEntry() {}

// Copy constructor.
PointEntry(const PointEntry<T>& r) : point(r.point), key(r.key) {}

// Constructor.
PointEntry(const T& _point) {
point = _point;
key = MakeKey(_point.Position.x, _point.Position.y, _point.Position.z);
Expand Down
17 changes: 12 additions & 5 deletions 3D/Vertex.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,18 @@ struct Vertex {
DXVector3 Normal;
DXColor Color;

Vertex() {
Color.r = 1.0f;
Color.g = 1.0f;
Color.b = 1.0f;
Color.a = 1.0f;
// Default constructor.
Vertex(float r = 1, float g = 1, float b = 1, float a = 1) {
Color.r = r;
Color.g = g;
Color.b = b;
Color.a = a;
}

Vertex(const Vertex &r) {
Position = r.Position;
Normal = r.Normal;
Color = r.Color;
}

static const ShaderVertexLayout Layout[3];
Expand Down
17 changes: 16 additions & 1 deletion Account/Account.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#ifndef __MQL__
// Allows the preprocessor to include a header file when it is needed.
#pragma once
#include "../Serializer.enum.h"
#include "../Serializer/Serializer.enum.h"
#endif

// Forward class declaration.
Expand All @@ -48,6 +48,21 @@ struct AccountEntry {
double margin_used;
double margin_free;
double margin_avail;

// Default constructor.
AccountEntry() {}

// Constructor.
AccountEntry(const AccountEntry& r)
: dtime(r.dtime),
balance(r.balance),
credit(r.credit),
equity(r.equity),
profit(r.profit),
margin_used(r.margin_used),
margin_free(r.margin_free),
margin_avail(r.margin_avail) {}

// Serializers.
void SerializeStub(int _n1 = 1, int _n2 = 1, int _n3 = 1, int _n4 = 1, int _n5 = 1) {}
SerializerNodeType Serialize(Serializer& _s) {
Expand Down
3 changes: 2 additions & 1 deletion Account/AccountBase.struct.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@
#ifndef __MQL__
// Allows the preprocessor to include a header file when it is needed.
#pragma once
#include "../Serializer.enum.h"
#include "../Serializer/Serializer.enum.h"
#endif

// Forward class declaration.
class Serializer;

// Includes.
#include "../Serializer/Serializer.h"
#include "../Std.h"
#include "../Terminal.define.h"

// Struct for account entries.
Expand Down
Loading

0 comments on commit 2911097

Please sign in to comment.