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

Remove designated array initializers in rz_analysis.h #3876

Merged
merged 3 commits into from
Sep 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 27 additions & 5 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,31 @@ environment:
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
BUILD_DIR: build
RUN_TESTS: false
TEST_INCLUDE_HEADERS_CPP: false
# VS2022 64
- builder: vs2022_64
PYTHON: 'C:\\Python38-x64'
INNO_SETUP: 'C:\\Program Files (x86)\\Inno Setup 6'
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
BUILD_DIR: build
RUN_TESTS: true
TEST_INCLUDE_HEADERS_CPP: true
# VS2017 64 (Dynamic linking)
- builder: vs2017_64_dyn
PYTHON: 'C:\\Python37'
INNO_SETUP: 'C:\\Program Files (x86)\\Inno Setup 5'
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
BUILD_DIR: build
RUN_TESTS: false
TEST_INCLUDE_HEADERS_CPP: false
# Clang-cl 64 (Dynamic linking)
- builder: clang_cl_64_dyn
PYTHON: 'C:\\Python38'
INNO_SETUP: 'C:\\Program Files (x86)\\Inno Setup 6'
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
BUILD_DIR: build
RUN_TESTS: true
TEST_INCLUDE_HEADERS_CPP: false

only_commits:
files:
Expand Down Expand Up @@ -79,12 +83,11 @@ build_script:

- cmd: if %builder% == clang_cl_64_dyn ( set "PATH=C:\mingw\bin;C:\mingw\msys\1.0\bin;%PYTHON%;%PATH%" && call "%VSVARSALLPATH2019%" x64 && set CC=clang-cl && %PYTHON%\Scripts\meson setup --buildtype=release --prefix="%CD%\%DIST_FOLDER%" build && %PYTHON%\Scripts\ninja -C build install && 7z a %ARTIFACT_ZIP% %DIST_FOLDER% )

# Run tests only conditionally
for:
-
matrix:
only:
- RUN_TESTS: true
# Run tests only conditionally
- matrix:
only:
- RUN_TESTS: true

test_script:
- if %builder% == vs2017_64 ( call "%VSVARSALLPATH2017%" x64 )
Expand All @@ -105,6 +108,25 @@ for:
- rz-test -o results.json -L db
- cd ..

# Include header files from C++
- matrix:
only:
- TEST_INCLUDE_HEADERS_CPP: true

test_script:
- if %builder% == vs2017_64 ( call "%VSVARSALLPATH2017%" x64 )
- if %builder% == vs2022_64 ( call "%VSVARSALLPATH2022%" x64 )
- if %builder% == vs2017_64_dyn ( call "%VSVARSALLPATH2017%" x64 )
- if %builder% == clang_cl_64_dyn ( call "%VSVARSALLPATH2019%" x64 )
- set PATH=%APPVEYOR_BUILD_FOLDER%\%DIST_FOLDER%\bin;C:\Python38-x64;C:\msys64\mingw64\bin;%PATH%
- echo %PATH%
- where rizin
- rizin -v
- copy C:\Python38-x64\python.exe C:\Python38-x64\python3.exe
- "%PYTHON%\\Scripts\\meson setup build-cpp-test ./test/unit/cpp"
- "%PYTHON%\\Scripts\\meson compile -C build-cpp-test"
- "%PYTHON%\\Scripts\\meson test -C build-cpp-test --print-errorlogs"

# Artifacts
artifacts:
# Binaries
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -739,8 +739,8 @@ jobs:
name: rizin-android-${{ matrix.name }}
path: /tmp/rizin-android-${{ matrix.name }}.tar.gz

build-cpp:
name: Include Rizin headers from C++ program
build-cpp-linux:
name: Include Rizin headers from C++ program (Linux)
runs-on: ubuntu-22.04
if: contains(github.head_ref, 'dist') || contains(github.head_ref, 'cpp') || ((contains(github.ref, 'release-') || github.ref == 'refs/heads/stable') && github.event_name == 'push') || github.event_name == 'schedule'
needs: [build-and-test]
Expand Down
18 changes: 11 additions & 7 deletions librz/include/rz_analysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,8 @@ typedef enum rz_analysis_var_kind_t {
RZ_ANALYSIS_VAR_KIND_INVALID = 0, ///< Invalid or unspecified variable
RZ_ANALYSIS_VAR_KIND_FORMAL_PARAMETER, ///< Variable is function formal parameter
RZ_ANALYSIS_VAR_KIND_VARIABLE, ///< Variable is local variable
/* End enum */
RZ_ANALYSIS_VAR_KIND_END ///< Number of RzAnalysisVarKind enums
} RzAnalysisVarKind;

typedef struct dwarf_variable_t {
Expand All @@ -728,17 +730,19 @@ typedef struct dwarf_variable_t {
typedef enum {
RZ_ANALYSIS_VAR_ORIGIN_NONE = 0, ///< Variable was created from rizin
RZ_ANALYSIS_VAR_ORIGIN_DWARF, ///< Variable was created from DWARF information
/* End enum */
RZ_ANALYSIS_VAR_ORIGIN_END ///< Number of RzAnalysisVarOriginKind enums
} RzAnalysisVarOriginKind;

static const char *RzAnalysisVarKind_strings[] = {
[RZ_ANALYSIS_VAR_KIND_INVALID] = "invalid",
[RZ_ANALYSIS_VAR_KIND_FORMAL_PARAMETER] = "formal_parameter",
[RZ_ANALYSIS_VAR_KIND_VARIABLE] = "variable",
static const char *RzAnalysisVarKind_strings[RZ_ANALYSIS_VAR_KIND_END] = {
"invalid", /* RZ_ANALYSIS_VAR_KIND_INVALID */
"formal_parameter", /* RZ_ANALYSIS_VAR_KIND_FORMAL_PARAMETER */
"variable", /* RZ_ANALYSIS_VAR_KIND_VARIABLE */
};

static const char *RzAnalysisVarOriginKind_strings[] = {
[RZ_ANALYSIS_VAR_ORIGIN_NONE] = "none",
[RZ_ANALYSIS_VAR_ORIGIN_DWARF] = "DWARF",
static const char *RzAnalysisVarOriginKind_strings[RZ_ANALYSIS_VAR_ORIGIN_END] = {
"none", /* RZ_ANALYSIS_VAR_ORIGIN_NONE */
"DWARF", /* RZ_ANALYSIS_VAR_ORIGIN_DWARF */
};

#define RZ_ANALYSIS_AS_STRING_IMPL(T, name, strings) \
Expand Down