Skip to content

Commit 04d5a21

Browse files
author
Matt Woodward
committed
Add some obnoxiously loud warnings to deprecated APIs
1 parent acf5714 commit 04d5a21

File tree

528 files changed

+6123
-1027
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

528 files changed

+6123
-1027
lines changed

c/BUILD.bazel

+6
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ swift_cc_test(
8080
includes = [
8181
"include/libsbp",
8282
],
83+
copts = [
84+
"-Wno-deprecated-declarations",
85+
],
8386
type = UNIT,
8487
deps = [
8588
":sbp",
@@ -146,6 +149,9 @@ swift_cc_test(
146149
data = [
147150
"test/legacy/cpp/sbp_data/gnss_data.sbp",
148151
],
152+
copts = [
153+
"-Wno-deprecated-declarations",
154+
],
149155
type = UNIT,
150156
deps = [
151157
":sbp",

c/include/libsbp/legacy/acquisition.h

+14-8
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,12 @@
2525

2626
#include <libsbp/common.h>
2727

28+
SBP_MESSAGE(
29+
"The legacy libsbp API has been deprecated. This file and all symbols "
30+
"contained will "
31+
"be removed in version 6. You should immediately switch over to the modern "
32+
"libsbp API.")
33+
2834
#include <libsbp/acquisition_macros.h>
2935
#include <libsbp/legacy/gnss.h>
3036

@@ -38,7 +44,7 @@ SBP_PACK_START
3844
* the best carrier-to-noise (CN/0) ratio.
3945
*/
4046

41-
typedef struct SBP_ATTR_PACKED {
47+
typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
4248
float cn0; /**< CN/0 of best point [dB Hz] */
4349
float cp; /**< Code phase of best point [chips] */
4450
float cf; /**< Carrier frequency of best point [hz] */
@@ -51,7 +57,7 @@ typedef struct SBP_ATTR_PACKED {
5157
* Deprecated.
5258
*/
5359

54-
typedef struct SBP_ATTR_PACKED {
60+
typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
5561
float cn0; /**< CN/0 of best point [dB Hz] */
5662
float cp; /**< Code phase of best point [chips] */
5763
float cf; /**< Carrier frequency of best point [hz] */
@@ -64,7 +70,7 @@ typedef struct SBP_ATTR_PACKED {
6470
* Deprecated.
6571
*/
6672

67-
typedef struct SBP_ATTR_PACKED {
73+
typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
6874
float snr; /**< SNR of best point. Currently in arbitrary SNR points, but
6975
will be in units of dB Hz in a later revision of this
7076
message. */
@@ -79,7 +85,7 @@ typedef struct SBP_ATTR_PACKED {
7985
* Deprecated.
8086
*/
8187

82-
typedef struct SBP_ATTR_PACKED {
88+
typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
8389
float snr; /**< SNR of best point. Currently dimensionless, but will have
8490
units of dB Hz in the revision of this message. */
8591
float cp; /**< Code phase of best point [chips] */
@@ -95,7 +101,7 @@ typedef struct SBP_ATTR_PACKED {
95101
* the performance.
96102
*/
97103

98-
typedef struct SBP_ATTR_PACKED {
104+
typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
99105
u8 job_type; /**< SV search job type (deep, fallback, etc) */
100106
u8 status; /**< Acquisition status 1 is Success, 0 is Failure */
101107
u16 cn0; /**< CN0 value. Only valid if status is '1' [dB-Hz*10] */
@@ -118,7 +124,7 @@ typedef struct SBP_ATTR_PACKED {
118124
* Deprecated.
119125
*/
120126

121-
typedef struct SBP_ATTR_PACKED {
127+
typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
122128
u8 job_type; /**< SV search job type (deep, fallback, etc) */
123129
u8 status; /**< Acquisition status 1 is Success, 0 is Failure */
124130
u16 cn0; /**< CN0 value. Only valid if status is '1' [dB-Hz*10] */
@@ -142,7 +148,7 @@ typedef struct SBP_ATTR_PACKED {
142148
* is used to debug and measure the performance.
143149
*/
144150

145-
typedef struct SBP_ATTR_PACKED {
151+
typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
146152
acq_sv_profile_t
147153
acq_sv_profile[0]; /**< SV profiles during acquisition time */
148154
} msg_acq_sv_profile_t;
@@ -152,7 +158,7 @@ typedef struct SBP_ATTR_PACKED {
152158
* Deprecated.
153159
*/
154160

155-
typedef struct SBP_ATTR_PACKED {
161+
typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
156162
acq_sv_profile_dep_t acq_sv_profile[0]; /**< SV profiles during acquisition
157163
time */
158164
} msg_acq_sv_profile_dep_t;

c/include/libsbp/legacy/api.h

+10-6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
#include <libsbp/common.h>
1717
#include <libsbp/legacy/callbacks.h>
1818

19+
SBP_MESSAGE(
20+
"The legacy libsbp API has been deprecated. This file and all symbols contained will "
21+
"be removed in version 6. You should immediately switch over to the modern libsbp API.")
22+
1923
#ifdef __cplusplus
2024
extern "C" {
2125
#endif
@@ -36,7 +40,7 @@ extern "C" {
3640
* `SBP_CALLBACK_ERROR` if the callback was already
3741
* registered for that message type.
3842
*/
39-
SBP_EXPORT s8 sbp_payload_callback_register(sbp_state_t* s, u16 msg_type, sbp_msg_callback_t cb, void* context,
43+
SBP_EXPORT SBP_DEPRECATED s8 sbp_payload_callback_register(sbp_state_t* s, u16 msg_type, sbp_msg_callback_t cb, void* context,
4044
sbp_msg_callbacks_node_t *node);
4145

4246
/** Register a frame callback for a msg_type.
@@ -51,7 +55,7 @@ SBP_EXPORT s8 sbp_payload_callback_register(sbp_state_t* s, u16 msg_type, sbp_ms
5155
* `SBP_CALLBACK_ERROR` if the if callback was already
5256
* registered for that message type.
5357
*/
54-
SBP_EXPORT s8 sbp_frame_callback_register(sbp_state_t* s, u16 msg_type,
58+
SBP_EXPORT SBP_DEPRECATED s8 sbp_frame_callback_register(sbp_state_t* s, u16 msg_type,
5559
sbp_frame_callback_t cb, void* context,
5660
sbp_msg_callbacks_node_t *node);
5761

@@ -64,7 +68,7 @@ SBP_EXPORT s8 sbp_frame_callback_register(sbp_state_t* s, u16 msg_type,
6468
* \return `SBP_OK` (0) if successful, `SBP_NULL_ERROR` if a usage error,
6569
* `SBP_CALLBACK_ERROR` if the node already exists
6670
*/
67-
SBP_EXPORT s8 sbp_all_payload_callback_register(sbp_state_t *s, sbp_frame_callback_t cb,
71+
SBP_EXPORT SBP_DEPRECATED s8 sbp_all_payload_callback_register(sbp_state_t *s, sbp_frame_callback_t cb,
6872
void *context, sbp_msg_callbacks_node_t *node);
6973

7074
/** Directly process an SBP frame.
@@ -87,7 +91,7 @@ SBP_EXPORT s8 sbp_all_payload_callback_register(sbp_state_t *s, sbp_frame_callba
8791
* SBP_OK_CALLBACK_UNDEFINED` (2) if message decoded with no
8892
* associated callback.
8993
*/
90-
SBP_EXPORT s8 sbp_frame_process(sbp_state_t *s, u16 sender_id, u16 msg_type,
94+
SBP_EXPORT SBP_DEPRECATED s8 sbp_frame_process(sbp_state_t *s, u16 sender_id, u16 msg_type,
9195
u8 payload_len, u8 payload[], u16 frame_len, u8 frame[], u8 cb_mask);
9296

9397
/** Directly process an SBP message.
@@ -103,7 +107,7 @@ SBP_EXPORT s8 sbp_frame_process(sbp_state_t *s, u16 sender_id, u16 msg_type,
103107
* `SBP_OK_CALLBACK_UNDEFINED` (2) if message decoded with no associated
104108
* callback.
105109
*/
106-
SBP_EXPORT s8 sbp_payload_process(sbp_state_t *s, u16 sender_id, u16 msg_type, u8 msg_len,
110+
SBP_EXPORT SBP_DEPRECATED s8 sbp_payload_process(sbp_state_t *s, u16 sender_id, u16 msg_type, u8 msg_len,
107111
u8 payload[]);
108112

109113
/** Send SBP messages.
@@ -135,7 +139,7 @@ SBP_EXPORT s8 sbp_payload_process(sbp_state_t *s, u16 sender_id, u16 msg_type, u
135139
* \return `SBP_OK` (0) if successful, `SBP_WRITE_ERROR` if the message could
136140
* not be sent or was only partially sent.
137141
*/
138-
SBP_EXPORT s8 sbp_payload_send(sbp_state_t *s, u16 msg_type, u16 sender_id, u8 len, u8 *payload,
142+
SBP_EXPORT SBP_DEPRECATED s8 sbp_payload_send(sbp_state_t *s, u16 msg_type, u16 sender_id, u8 len, u8 *payload,
139143
sbp_write_fn_t write);
140144

141145
#ifdef __cplusplus

c/include/libsbp/legacy/bootload.h

+10-4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@
2929

3030
#include <libsbp/common.h>
3131

32+
SBP_MESSAGE(
33+
"The legacy libsbp API has been deprecated. This file and all symbols "
34+
"contained will "
35+
"be removed in version 6. You should immediately switch over to the modern "
36+
"libsbp API.")
37+
3238
#include <libsbp/bootload_macros.h>
3339

3440
SBP_PACK_START
@@ -48,7 +54,7 @@ SBP_PACK_START
4854
* number and the SBP protocol version number.
4955
*/
5056

51-
typedef struct SBP_ATTR_PACKED {
57+
typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
5258
u32 flags; /**< Bootloader flags */
5359
char version[0]; /**< Bootloader version number */
5460
} msg_bootloader_handshake_resp_t;
@@ -58,7 +64,7 @@ typedef struct SBP_ATTR_PACKED {
5864
* The host initiates the bootloader to jump to the application.
5965
*/
6066

61-
typedef struct SBP_ATTR_PACKED {
67+
typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
6268
u8 jump; /**< Ignored by the device */
6369
} msg_bootloader_jump_to_app_t;
6470

@@ -82,7 +88,7 @@ typedef struct SBP_ATTR_PACKED {
8288
* number.
8389
*/
8490

85-
typedef struct SBP_ATTR_PACKED {
91+
typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
8692
u8 dna[8]; /**< 57-bit SwiftNAP FPGA Device ID. Remaining bits are padded on
8793
the right. */
8894
} msg_nap_device_dna_resp_t;
@@ -92,7 +98,7 @@ typedef struct SBP_ATTR_PACKED {
9298
* Deprecated.
9399
*/
94100

95-
typedef struct SBP_ATTR_PACKED {
101+
typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
96102
u8 handshake[0]; /**< Version number string (not NULL terminated) */
97103
} msg_bootloader_handshake_dep_a_t;
98104

c/include/libsbp/legacy/compat.h

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
#include <libsbp/common.h>
1717
#include <libsbp/legacy/api.h>
1818

19+
SBP_MESSAGE(
20+
"The legacy libsbp API has been deprecated. This file and all symbols contained will "
21+
"be removed in version 6. You should immediately switch over to the modern libsbp API.")
22+
1923

2024
#ifdef __cplusplus
2125
extern "C" {

c/include/libsbp/legacy/cpp/frame_handler.h

+6-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020
#include <libsbp/cpp/state.h>
2121
#include <libsbp/legacy/cpp/message_traits.h>
2222

23+
SBP_MESSAGE(
24+
"The legacy libsbp API has been deprecated. This file and all symbols contained will "
25+
"be removed in version 6. You should immediately switch over to the modern libsbp API.")
26+
2327
namespace sbp {
2428

2529
/**
@@ -92,7 +96,7 @@ inline void sbp_frame_cb_passthrough(uint16_t sender_id, uint16_t msg_type,
9296
* @tparam MsgTypes List of SBP message types to register callbacks for
9397
*/
9498
template<typename ...MsgTypes>
95-
class FrameHandler {
99+
class SBP_DEPRECATED FrameHandler {
96100
static constexpr std::size_t kMsgCount = sizeof...(MsgTypes);
97101

98102
State &state_;
@@ -165,7 +169,7 @@ class FrameHandler {
165169
* };
166170
*
167171
*/
168-
class AllFrameHandler {
172+
class SBP_DEPRECATED AllFrameHandler {
169173
State &state_;
170174
sbp_msg_callbacks_node_t callback_node_;
171175

c/include/libsbp/legacy/cpp/payload_handler.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ namespace details {
6868
* @tparam OtherTypes Other types to recursively define interfaces for
6969
*/
7070
template<typename MsgType, typename... OtherTypes>
71-
class PayloadCallbackInterface : PayloadCallbackInterface<OtherTypes...> {
71+
class SBP_DEPRECATED PayloadCallbackInterface : PayloadCallbackInterface<OtherTypes...> {
7272
public:
7373
PayloadCallbackInterface() = default;
7474
~PayloadCallbackInterface() override = default;
@@ -88,7 +88,7 @@ class PayloadCallbackInterface : PayloadCallbackInterface<OtherTypes...> {
8888
};
8989

9090
template<typename MsgType>
91-
class PayloadCallbackInterface<MsgType> {
91+
class SBP_DEPRECATED PayloadCallbackInterface<MsgType> {
9292
public:
9393
PayloadCallbackInterface() = default;
9494
virtual ~PayloadCallbackInterface() = default;
@@ -144,7 +144,7 @@ class PayloadCallbackInterface<MsgType> {
144144
* @tparam MsgTypes List of SBP message types to register callbacks for
145145
*/
146146
template<typename... MsgTypes>
147-
class PayloadHandler : public details::PayloadCallbackInterface<MsgTypes...> {
147+
class SBP_DEPRECATED PayloadHandler : public details::PayloadCallbackInterface<MsgTypes...> {
148148
static constexpr std::size_t kMsgCount = sizeof...(MsgTypes);
149149

150150
State &state_;

c/include/libsbp/legacy/ext_events.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@
2626

2727
#include <libsbp/common.h>
2828

29+
SBP_MESSAGE(
30+
"The legacy libsbp API has been deprecated. This file and all symbols "
31+
"contained will "
32+
"be removed in version 6. You should immediately switch over to the modern "
33+
"libsbp API.")
34+
2935
#include <libsbp/ext_events_macros.h>
3036

3137
SBP_PACK_START
@@ -36,7 +42,7 @@ SBP_PACK_START
3642
* it was and whether it was rising or falling.
3743
*/
3844

39-
typedef struct SBP_ATTR_PACKED {
45+
typedef struct SBP_ATTR_PACKED SBP_DEPRECATED {
4046
u16 wn; /**< GPS week number [weeks] */
4147
u32 tow; /**< GPS time of week rounded to the nearest millisecond [ms] */
4248
s32 ns_residual; /**< Nanosecond residual of millisecond-rounded TOW

0 commit comments

Comments
 (0)