-
Notifications
You must be signed in to change notification settings - Fork 0
Ote #2
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
Open
Golem24434
wants to merge
7
commits into
main
Choose a base branch
from
ote
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Ote #2
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| .vscode | ||
| build |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| dist: focal | ||
| sudo: required # используем Virtual Machine (а не Docker container) | ||
|
|
||
| language: c | ||
|
|
||
| os: | ||
| - linux | ||
|
|
||
| compiler: | ||
| - gcc | ||
|
|
||
| addons: | ||
| apt: | ||
| packages: | ||
| - cmake | ||
| - lcov | ||
| - gcovr | ||
|
|
||
| install: | ||
| - sudo apt -y install python3-pip | ||
| - sudo apt-get install valgrind | ||
| - sudo pip3 install cpplint | ||
| - sudo apt update | ||
| - sudo apt install build-essential | ||
| - sudo apt install libgtest-dev | ||
| - sudo apt-get install cmake | ||
| - sudo apt-get install -y gcovr | ||
| - sudo apt install lcov | ||
| - sudo apt install cppcheck | ||
| - sudo apt install curl | ||
|
|
||
| before_script: | ||
| - sudo apt-get install -y libgtest-dev | ||
| - cd /usr/src/gtest | ||
| - sudo cmake CMakeLists.txt && sudo make | ||
| - cd "${TRAVIS_BUILD_DIR}"/ | ||
| - ls | ||
| - sudo mkdir build | ||
| - cd build | ||
| - sudo cmake .. | ||
| - sudo make clean | ||
| - sudo make | ||
| - cd .. | ||
| - cd .. | ||
|
|
||
| script: | ||
| - cpplint --extensions=c,cpp src/main.c src/find_letters.c include/testy/find_letters.h test/main.cpp | ||
| - cppcheck --enable=warning,performance,portability,style --language=c++ ./ | ||
| - valgrind --track-origins=yes --child-silent-after-fork=yes --leak-check=full "${TRAVIS_BUILD_DIR}"/build/TEST | ||
| - cd "${TRAVIS_BUILD_DIR}"/src | ||
| - bash <(curl -s https://codecov.io/bash) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "C_Cpp.errorSquiggles": "Disabled", | ||
| "files.associations": { | ||
| "find_letters.h": "c", | ||
| "stdio.h": "c", | ||
| "types.h": "c" | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| cmake_minimum_required(VERSION 3.16) | ||
| project(try C CXX) | ||
|
|
||
| set(CMAKE_C_STANDARD 11) | ||
| set(CMAKE_CXX_STANDARD 17) | ||
|
|
||
| set(CMAKE_C_FLAGS "-g -Wall -Werror -Wextra -O3 -fprofile-arcs -ftest-coverage") | ||
| set(CMAKE_CXX_FLAGS "-g -Wall -O3 -fprofile-arcs -ftest-coverage") | ||
|
|
||
| find_package(GTest REQUIRED) | ||
| find_package(Threads REQUIRED) | ||
|
|
||
|
|
||
|
|
||
| set(DIR ${CMAKE_CURRENT_SOURCE_DIR}) | ||
| add_definitions(-DSOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}") | ||
|
|
||
| set(INC_DIR ${DIR}/include/testy) | ||
|
|
||
| set(SRC_DIR ${DIR}/src) | ||
|
|
||
| set(TESTS_DIR ${DIR}/test) | ||
|
|
||
| include_directories("${GTEST_INCLUDE_DIRS}") | ||
| include_directories(/include/testy) | ||
|
|
||
| add_library(f_letter STATIC | ||
| ${INC_DIR}/find_letters.h | ||
| ${SRC_DIR}/find_letters.c) | ||
|
|
||
| add_library(multi_compute_matrix MODULE | ||
| ${INC_DIR}/find_letters.h | ||
| ${SRC_DIR}/find_letters.c) | ||
|
|
||
| add_executable(TEST | ||
| test/main.cpp) | ||
|
|
||
| target_include_directories(TEST PUBLIC ${INC_DIR}) | ||
|
|
||
| target_link_libraries(TEST ${GTEST_LIBRARIES} Threads::Threads pthread -ldl f_letter) | ||
|
|
||
| enable_testing() | ||
|
|
||
|
|
||
|
|
||
| add_executable(try | ||
| ${SRC_DIR}/main.c) | ||
|
|
||
| target_link_libraries(try Threads::Threads pthread -ldl f_letter) | ||
|
|
||
| target_include_directories(try PUBLIC ${INC_DIR}) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| cmake_minimum_required(VERSION 3.1) | ||
|
|
||
| project(googletest-download NONE) | ||
|
|
||
| set(CMAKE_CXX_STANDARD 11) | ||
| set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}-pthread") | ||
|
|
||
| include(ExternalProject) | ||
| ExternalProject_Add(googletest | ||
| GIT_REPOSITORY https://github.com/google/googletest.git | ||
| GIT_TAG release-1.8.1 | ||
| SOURCE_DIR "${CMAKE_BINARY_DIR}/googletest-src" | ||
| BINARY_DIR "${CMAKE_BINARY_DIR}/googletest-build" | ||
| CONFIGURE_COMMAND "" | ||
| BUILD_COMMAND "" | ||
| INSTALL_COMMAND "" | ||
| TEST_COMMAND "" | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| headers=h | ||
| linelength=120 | ||
| filter=-runtime/int | ||
| filter=-legal/copyright | ||
| filter=-build/include_subdir | ||
| filter=-build/include |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| #ifndef FUNCTION_H | ||
| #define FUNCTION_H | ||
|
|
||
| #include <stdio.h> | ||
| #include <stdlib.h> | ||
| #include <stdbool.h> | ||
| #include <math.h> | ||
| #include <unistd.h> | ||
| #include <sys/types.h> | ||
| #include <sys/mman.h> | ||
| #include <sys/wait.h> | ||
| #include <time.h> | ||
| #include <dlfcn.h> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. много инклюдов в публичном хедере, здесь должны подключаться только необходимые заголовки6 остальные в |
||
|
|
||
| #define MAX_NUMBER_LETTERS 1000000 | ||
| #define MAX_NUMBER_TOPICS 1000 | ||
|
|
||
|
|
||
| typedef struct letter letter; | ||
| typedef struct date_frame date_frame; | ||
| typedef struct str_topics str_topics; | ||
|
|
||
| struct str_topics { | ||
| int number; | ||
| char topics[100][10]; | ||
| }; | ||
|
|
||
|
|
||
| struct date_frame { | ||
| int year; | ||
| int month; | ||
| int day; | ||
| }; | ||
|
|
||
| struct letter { | ||
| int sender_id; | ||
| int ecipient_id[10]; | ||
| char topic[10]; | ||
| int number_ecipient; | ||
| date_frame date; | ||
| }; | ||
|
|
||
| int testing_letters_el(letter** letters, int N); | ||
|
|
||
| int date_in_key(date_frame date); | ||
|
|
||
| int binary_search(letter** k, int key, int N); | ||
|
|
||
| int get_number_process(); | ||
|
|
||
| int fill_in_elements(letter** letters); | ||
|
|
||
| str_topics* singleprocces_find_topic(letter** letters, int start,int end, int number_user); | ||
|
|
||
| str_topics* multiprocess_find_topic(letter** letters, int start,int end, int number_user); | ||
|
|
||
| int equality_test(str_topics* topics1,str_topics* topics2); | ||
| #endif | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
лучше использовать SHARED