Remove the discard_const() macro
Declare dynamically allocated strings as 'char *' instead of 'const char *'. Remove the discard_const() macro. Do not test whether or not a pointer is NULL before calling free() because it is allowed to pass NULL to free(). Signed-off-by: Bart Van Assche <bvanassche@acm.org>
This commit is contained in:
@@ -31,10 +31,6 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef discard_const
|
||||
#define discard_const(ptr) ((void *)((intptr_t)(ptr)))
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
@@ -549,12 +549,12 @@ EXTERN int iscsi_logout_sync(struct iscsi_context *iscsi);
|
||||
|
||||
struct iscsi_target_portal {
|
||||
struct iscsi_target_portal *next;
|
||||
const char *portal;
|
||||
char *portal;
|
||||
};
|
||||
|
||||
struct iscsi_discovery_address {
|
||||
struct iscsi_discovery_address *next;
|
||||
const char *target_name;
|
||||
char *target_name;
|
||||
struct iscsi_target_portal *portals;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user