remove some unused defines

This commit is contained in:
2026-08-12 14:04:49 +03:00
parent 8bf7738e8a
commit e2c0445c1b
15 changed files with 77 additions and 128 deletions
+2
View File
@@ -243,6 +243,7 @@ if(DEFINED PICO_BOARD)
set(PIP_HAS_DYNLIB OFF CACHE BOOL "" FORCE)
set(PIP_HAS_FFT OFF CACHE BOOL "" FORCE)
set(PIP_HAS_SERIAL OFF CACHE BOOL "" FORCE)
set(PIP_BUILD_CONSOLE OFF CACHE BOOL "" FORCE)
message(STATUS "Building PIP for Pi Pico SDK ${PICO_SDK_VERSION_STRING}")
endif()
@@ -257,6 +258,7 @@ if(PIP_FREERTOS)
set(PIP_HAS_DYNLIB OFF CACHE BOOL "" FORCE)
set(PIP_HAS_FFT OFF CACHE BOOL "" FORCE)
set(PIP_HAS_SERIAL OFF CACHE BOOL "" FORCE)
set(PIP_BUILD_CONSOLE OFF CACHE BOOL "" FORCE)
endif()
if(DEFINED ANDROID_PLATFORM)
-5
View File
@@ -22,11 +22,9 @@
#include "piliterals_time.h"
// clang-format off
#ifndef WINDOWS
#ifndef PICO_SDK
# include <fcntl.h>
# include <sys/ioctl.h>
# include <termios.h>
#endif // PICO_SDK
#else
# include <wingdi.h>
# include <wincon.h>
@@ -37,7 +35,6 @@
// clang-format on
#if !defined(PICO_SDK)
using namespace PIScreenTypes;
@@ -660,5 +657,3 @@ PIScreenTile * PIScreen::tileByName(const PIString & name) {
if (t->name() == name) return t;
return 0;
}
#endif // !PICO_SDK
+2 -2
View File
@@ -19,7 +19,7 @@
#include "piscreendrawer.h"
#if !defined(PICO_SDK)
// comment for use ascii instead of unicode symbols
# define USE_UNICODE
@@ -267,4 +267,4 @@ void PIScreenDrawer::drawText(int x, int y, const PIString & s, Color col_char,
}
}
#endif // !PICO_SDK
+2 -2
View File
@@ -21,7 +21,7 @@
#include "piscreendrawer.h"
#if !defined(PICO_SDK)
using namespace PIScreenTypes;
@@ -258,4 +258,4 @@ void PIScreenTile::layout() {
}
}
#endif // !PICO_SDK
+2 -2
View File
@@ -21,7 +21,7 @@
#include "piscreendrawer.h"
#if !defined(PICO_SDK)
using namespace PIScreenTypes;
@@ -695,4 +695,4 @@ void TileInput::reserCursor() {
inv = false;
}
#endif // !PICO_SDK
+2 -2
View File
@@ -22,7 +22,7 @@
#include "piliterals_time.h"
#include "pisharedmemory.h"
#if !defined(PICO_SDK)
#ifdef PIP_HAS_PROCESS
# ifdef WINDOWS
# include <windows.h>
@@ -981,4 +981,4 @@ bool PITerminal::resize(int cols, int rows) {
#endif // PIP_HAS_PROCESS
#endif // !PICO_SDK
+2 -2
View File
@@ -34,7 +34,7 @@
//! \~\brief
//! \~english Console screen manager with tile layout, drawing, and input routing.
//! \~russian Менеджер консольного экрана с раскладкой тайлов, отрисовкой и маршрутизацией ввода.
#if !defined(PICO_SDK)
class PIP_CONSOLE_EXPORT PIScreen
: public PIThread
, public PIScreenTypes::PIScreenBase {
@@ -215,6 +215,6 @@ private:
PIScreenTile root;
PIScreenTile *tile_focus, *tile_dialog;
};
#endif // !PICO_SDK
#endif // PISCREEN_H
+2 -2
View File
@@ -24,7 +24,7 @@
#ifndef PISCREENDRAWER_H
#define PISCREENDRAWER_H
#if !defined(PICO_SDK)
#include "pip_console_export.h"
#include "piscreentypes.h"
@@ -147,5 +147,5 @@ private:
};
#endif // !PICO_SDK
#endif // PISCREENDRAWER_H
+2 -2
View File
@@ -38,7 +38,7 @@ class PIScreenDrawer;
//! \details
//! \~english Base class for all screen tiles providing layout and event handling.
//! \~russian Базовый класс для всех экранных тайлов, обеспечивающий компоновку и обработку событий.
#if !defined(PICO_SDK)
class PIP_CONSOLE_EXPORT PIScreenTile: public PIObject {
friend class PIScreen;
PIOBJECT_SUBCLASS(PIScreenTile, PIObject);
@@ -238,6 +238,6 @@ protected:
private:
int pw, ph;
};
#endif // !PICO_SDK
#endif // PISCREENTILE_H
+2 -2
View File
@@ -27,7 +27,7 @@
#ifndef PISCREENTILES_H
#define PISCREENTILES_H
#if !defined(PICO_SDK)
#include "pip_console_export.h"
#include "piscreentile.h"
@@ -445,5 +445,5 @@ protected:
};
#endif // !PICO_SDK
#endif // PISCREENTILES_H
+2 -2
View File
@@ -27,7 +27,7 @@
#ifndef PISCREENTYPES_H
#define PISCREENTYPES_H
#if !defined(PICO_SDK)
#include "pip_console_export.h"
#include "pivariant.h"
@@ -285,5 +285,5 @@ BINARY_STREAM_READ(PIScreenTypes::TileEvent) {
REGISTER_PIVARIANTSIMPLE(PIScreenTypes::TileEvent)
#endif // !PICO_SDK
#endif // PISCREENTYPES_H
+2 -2
View File
@@ -24,7 +24,7 @@
#ifndef PITERMINAL_H
#define PITERMINAL_H
#if !defined(PICO_SDK)
#include "pikbdlistener.h"
#include "pip_console_export.h"
@@ -115,5 +115,5 @@ private:
};
#endif // !PICO_SDK
#endif // PITERMINAL_H
+3 -14
View File
@@ -19,13 +19,13 @@
#include "piobject.h"
#include "piconditionvar.h"
#include "pithread.h"
#include "pitime.h"
#ifdef PIP_HAS_THREADS
# include "piconditionvar.h"
# include "pifile.h"
# include "piiostream.h"
# include "pisysteminfo.h"
# include "pithread.h"
#endif
@@ -176,13 +176,9 @@ PIObject::PIObject(const PIString & name): _signature_(__PIOBJECT_SIGNATURE__),
in_event_cnt = 0;
setName(name);
setDebug(true);
#ifdef PIP_HAS_THREADS
mutexObjects().lock();
#endif
objects() << this;
#ifdef PIP_HAS_THREADS
mutexObjects().unlock();
#endif
// piCout << "new" << this;
}
@@ -190,13 +186,9 @@ PIObject::PIObject(const PIString & name): _signature_(__PIOBJECT_SIGNATURE__),
PIObject::~PIObject() {
in_event_cnt = 0;
// piCout << "delete" << this;
#ifdef PIP_HAS_THREADS
mutexObjects().lock();
#endif
objects().removeAll(this);
#ifdef PIP_HAS_THREADS
mutexObjects().unlock();
#endif
deleted(this);
piDisconnectAll();
_signature_ = 0;
@@ -555,7 +547,6 @@ PIMap<uint, PIObject::__MetaData> & PIObject::__meta_data() {
}
#ifdef PIP_HAS_THREADS
void PIObject::callQueuedEvents() {
mutex_queue.lock();
PIVector<__QueuedEvent> qe = events_queue;
@@ -569,7 +560,6 @@ void PIObject::callQueuedEvents() {
if (e.dest_o->thread_safe_) e.dest_o->mutex_.unlock();
}
}
#endif // PIP_HAS_THREADS
//! \details
@@ -734,8 +724,7 @@ void PIObject::dump(const PIString & line_prefix) const {
PICout(PICoutManipulators::AddNewLine) << line_prefix << " " << src << " -> " << dst->className() << " (" << c.dest
<< ", \"" << dst->name() << "\")::" << hf_fn;
} else {
PICout(PICoutManipulators::AddNewLine) << line_prefix << " " << src << " -> "
<< "[lambda]";
PICout(PICoutManipulators::AddNewLine) << line_prefix << " " << src << " -> " << "[lambda]";
}
}
// printf("dump %d connections ok\n",connections.size());
-29
View File
@@ -461,9 +461,7 @@ public:
i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender));
} else {
bool ts = sender->thread_safe_;
#ifdef PIP_HAS_THREADS
if (ts) i.dest_o->mutex_.lock();
#endif
i.dest_o->eventBegin();
sender->eventBegin();
i.dest_o->emitter_ = sender;
@@ -471,9 +469,7 @@ public:
sender->eventEnd();
if (i.dest_o->isPIObject()) {
i.dest_o->emitter_ = 0;
#ifdef PIP_HAS_THREADS
if (ts) i.dest_o->mutex_.unlock();
#endif
i.dest_o->eventEnd();
}
}
@@ -498,9 +494,7 @@ public:
i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender, vl));
} else {
bool ts = sender->thread_safe_;
#ifdef PIP_HAS_THREADS
if (ts) i.dest_o->mutex_.lock();
#endif
i.dest_o->eventBegin();
sender->eventBegin();
i.dest_o->emitter_ = sender;
@@ -511,9 +505,7 @@ public:
sender->eventEnd();
if (i.dest_o->isPIObject()) {
i.dest_o->emitter_ = 0;
#ifdef PIP_HAS_THREADS
if (ts) i.dest_o->mutex_.unlock();
#endif
i.dest_o->eventEnd();
}
}
@@ -538,9 +530,7 @@ public:
i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender, vl));
} else {
bool ts = sender->thread_safe_;
#ifdef PIP_HAS_THREADS
if (ts) i.dest_o->mutex_.lock();
#endif
i.dest_o->eventBegin();
sender->eventBegin();
i.dest_o->emitter_ = sender;
@@ -552,9 +542,7 @@ public:
sender->eventEnd();
if (i.dest_o->isPIObject()) {
i.dest_o->emitter_ = 0;
#ifdef PIP_HAS_THREADS
if (ts) i.dest_o->mutex_.unlock();
#endif
i.dest_o->eventEnd();
}
}
@@ -580,9 +568,7 @@ public:
i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender, vl));
} else {
bool ts = sender->thread_safe_;
#ifdef PIP_HAS_THREADS
if (ts) i.dest_o->mutex_.lock();
#endif
i.dest_o->eventBegin();
sender->eventBegin();
i.dest_o->emitter_ = sender;
@@ -595,9 +581,7 @@ public:
sender->eventEnd();
if (i.dest_o->isPIObject()) {
i.dest_o->emitter_ = 0;
#ifdef PIP_HAS_THREADS
if (ts) i.dest_o->mutex_.unlock();
#endif
i.dest_o->eventEnd();
}
}
@@ -629,9 +613,7 @@ public:
i.performer->postQueuedEvent(__QueuedEvent(i.slot, i.dest, i.dest_o, sender, vl));
} else {
bool ts = sender->thread_safe_;
#ifdef PIP_HAS_THREADS
if (ts) i.dest_o->mutex_.lock();
#endif
i.dest_o->eventBegin();
sender->eventBegin();
i.dest_o->emitter_ = sender;
@@ -645,9 +627,7 @@ public:
sender->eventEnd();
if (i.dest_o->isPIObject()) {
i.dest_o->emitter_ = 0;
#ifdef PIP_HAS_THREADS
if (ts) i.dest_o->mutex_.unlock();
#endif
i.dest_o->eventEnd();
}
}
@@ -658,7 +638,6 @@ public:
//! \~english Returns the first live object with name "name", or \c nullptr.
//! \~russian Возвращает первый живой объект с именем "name", либо \c nullptr.
#ifdef PIP_HAS_THREADS
static PIObject * findByName(const PIString & name) {
PIMutexLocker _ml(mutexObjects());
for (auto * i: PIObject::objects()) {
@@ -667,7 +646,6 @@ public:
}
return nullptr;
}
#endif
//! \~english Returns whether this pointer still refers to a live %PIObject instance.
//! \~russian Возвращает, указывает ли этот указатель на ещё существующий экземпляр %PIObject.
@@ -675,7 +653,6 @@ public:
//! \~english Returns whether this object belongs to class "T" or one of its registered descendants.
//! \~russian Возвращает, принадлежит ли этот объект классу "T" или одному из его зарегистрированных потомков.
#ifdef PIP_HAS_THREADS
template<typename T>
bool isTypeOf() const {
if (!isPIObject()) return false;
@@ -690,7 +667,6 @@ public:
if (!isTypeOf<T>()) return (T *)nullptr;
return (T *)this;
}
#endif
//! \~english Returns whether "o" points to a live %PIObject instance.
//! \~russian Возвращает, указывает ли "o" на ещё существующий экземпляр %PIObject.
@@ -859,13 +835,8 @@ private:
PIObject * emitter_;
std::atomic_int in_event_cnt;
#ifdef PIP_HAS_THREADS
PIMutex mutex_, mutex_connect, mutex_queue;
bool thread_safe_, proc_event_queue;
#else
PIMutex mutex_, mutex_connect, mutex_queue;
bool thread_safe_ = false, proc_event_queue = false;
#endif
};
#ifdef PIP_HAS_THREADS
+1 -9
View File
@@ -20,10 +20,8 @@
#include "pivarianttypes.h"
#include "colors_p.h"
#include "pipropertystorage.h"
#ifdef PIP_HAS_FILESYSTEM
#include "piiodevice.h"
#endif // PIP_HAS_FILESYSTEM
#include "pipropertystorage.h"
int PIVariantTypes::Enum::selectedValue() const {
@@ -84,11 +82,7 @@ PIStringList PIVariantTypes::Enum::names() const {
PIVariantTypes::IODevice::IODevice() {
#ifdef PIP_HAS_FILESYSTEM
mode = PIIODevice::ReadWrite;
#else
mode = 0; // TODO: PIIODevice for PIP_HAS_FILESYSTEM
#endif // PIP_HAS_FILESYSTEM
options = 0;
}
@@ -121,12 +115,10 @@ PIString PIVariantTypes::IODevice::toPICout() const {
}
if (rwc == 1) s += "o";
s += ", flags=";
#ifdef PIP_HAS_FILESYSTEM // TODO: PIIODevice for !PIP_HAS_FILESYSTEM
if (options != 0) {
if (((PIIODevice::DeviceOptions)options)[PIIODevice::BlockingRead]) s += " br";
if (((PIIODevice::DeviceOptions)options)[PIIODevice::BlockingWrite]) s += " bw";
}
#endif // PIP_HAS_FILESYSTEM
PIPropertyStorage ps = get();
for (const auto & p: ps) {
s += ", " + p.name + "=\"" + p.value.toString() + "\"";