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

cleanup #60

Merged
merged 5 commits into from
Nov 18, 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
20 changes: 5 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
cmake_minimum_required(VERSION 3.1)
cmake_minimum_required(VERSION 3.12)
project(cannelloni)

list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")

# Options
option(SCTP_SUPPORT "SCTP_SUPPORT" ON)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")

if(SCTP_SUPPORT)
include(FindSCTP)
Expand All @@ -20,19 +23,6 @@ if(NOT SCTP_FOUND AND SCTP_SUPPORT)
message(STATUS "Install lksctp-tools for SCTP.")
endif(NOT SCTP_FOUND AND SCTP_SUPPORT)

find_file(LINUX_VERSION_H "linux/version.h")
if(LINUX_VERSION_H)
execute_process(
COMMAND sed -n "s/#define\\s\\+LINUX_VERSION_CODE\\s\\+\\([0-9]\\+\\)/\\1/p" ${LINUX_VERSION_H}
OUTPUT_VARIABLE LINUX_VERSION_CODE
)
if(LINUX_VERSION_CODE LESS 198144)
# The Linux Kernel headers are older than version 3.6
# We need to use the ones shipped with cannelloni
include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include)
endif()
endif()

CONFIGURE_FILE(
${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config.h
Expand Down
3 changes: 2 additions & 1 deletion canthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ int CANThread::start() {
return -1;
}
/* Determine the index of m_canInterfaceName */
strncpy(canInterface.ifr_name, m_canInterfaceName.c_str(), IFNAMSIZ);
strncpy(canInterface.ifr_name, m_canInterfaceName.c_str(), IFNAMSIZ-1);
canInterface.ifr_name[IF_NAMESIZE-1] = '\0';
if (ioctl(m_canSocket, SIOCGIFINDEX, &canInterface) < 0) {
lerror << "Could get index of interface >" << m_canInterfaceName << "<" << std::endl;
return -1;
Expand Down
194 changes: 0 additions & 194 deletions include/linux/can.h

This file was deleted.

98 changes: 0 additions & 98 deletions include/linux/can/bcm.h

This file was deleted.

Loading