Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3c87eda7
Commit
3c87eda7
authored
May 14, 2004
by
marko@hundin.mysql.fi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InnoDB: ut0mem: Remove ut_str_catenate(), add const qualifiers
parent
3a9e5901
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
48 deletions
+11
-48
innobase/include/ut0mem.h
innobase/include/ut0mem.h
+5
-16
innobase/include/ut0mem.ic
innobase/include/ut0mem.ic
+6
-6
innobase/ut/ut0mem.c
innobase/ut/ut0mem.c
+0
-26
No files found.
innobase/include/ut0mem.h
View file @
3c87eda7
...
...
@@ -18,15 +18,15 @@ extern ulint ut_total_allocated_memory;
UNIV_INLINE
void
*
ut_memcpy
(
void
*
dest
,
void
*
sour
,
ulint
n
);
ut_memcpy
(
void
*
dest
,
const
void
*
sour
,
ulint
n
);
UNIV_INLINE
void
*
ut_memmove
(
void
*
dest
,
void
*
sour
,
ulint
n
);
ut_memmove
(
void
*
dest
,
const
void
*
sour
,
ulint
n
);
UNIV_INLINE
int
ut_memcmp
(
void
*
str1
,
void
*
str2
,
ulint
n
);
ut_memcmp
(
const
void
*
str1
,
const
void
*
str2
,
ulint
n
);
/**************************************************************************
...
...
@@ -75,7 +75,7 @@ ut_free_all_mem(void);
UNIV_INLINE
char
*
ut_strcpy
(
char
*
dest
,
char
*
sour
);
ut_strcpy
(
char
*
dest
,
c
onst
c
har
*
sour
);
UNIV_INLINE
ulint
...
...
@@ -83,7 +83,7 @@ ut_strlen(const char* str);
UNIV_INLINE
int
ut_strcmp
(
void
*
str1
,
void
*
str2
);
ut_strcmp
(
const
void
*
str1
,
const
void
*
str2
);
/**************************************************************************
Determine the length of a string when it is quoted with ut_strcpyq(). */
...
...
@@ -118,17 +118,6 @@ ut_memcpyq(
const
char
*
src
,
/* in: string to be quoted */
ulint
len
);
/* in: length of src */
/**************************************************************************
Catenates two strings into newly allocated memory. The memory must be freed
using mem_free. */
char
*
ut_str_catenate
(
/*============*/
/* out, own: catenated null-terminated string */
char
*
str1
,
/* in: null-terminated string */
char
*
str2
);
/* in: null-terminated string */
#ifndef UNIV_NONINL
#include "ut0mem.ic"
#endif
...
...
innobase/include/ut0mem.ic
View file @
3c87eda7
...
...
@@ -8,28 +8,28 @@ Created 5/30/1994 Heikki Tuuri
UNIV_INLINE
void*
ut_memcpy(void* dest, void* sour, ulint n)
ut_memcpy(void* dest,
const
void* sour, ulint n)
{
return(memcpy(dest, sour, n));
}
UNIV_INLINE
void*
ut_memmove(void* dest, void* sour, ulint n)
ut_memmove(void* dest,
const
void* sour, ulint n)
{
return(memmove(dest, sour, n));
}
UNIV_INLINE
int
ut_memcmp(
void* str1,
void* str2, ulint n)
ut_memcmp(
const void* str1, const
void* str2, ulint n)
{
return(memcmp(str1, str2, n));
}
UNIV_INLINE
char*
ut_strcpy(char* dest, char* sour)
ut_strcpy(char* dest, c
onst c
har* sour)
{
return(strcpy(dest, sour));
}
...
...
@@ -43,9 +43,9 @@ ut_strlen(const char* str)
UNIV_INLINE
int
ut_strcmp(
void* str1,
void* str2)
ut_strcmp(
const void* str1, const
void* str2)
{
return(strcmp((c
har*)str1, (
char*)str2));
return(strcmp((c
onst char*)str1, (const
char*)str2));
}
/**************************************************************************
...
...
innobase/ut/ut0mem.c
View file @
3c87eda7
...
...
@@ -273,29 +273,3 @@ ut_memcpyq(
return
(
dest
);
}
/**************************************************************************
Catenates two strings into newly allocated memory. The memory must be freed
using mem_free. */
char
*
ut_str_catenate
(
/*============*/
/* out, own: catenated null-terminated string */
char
*
str1
,
/* in: null-terminated string */
char
*
str2
)
/* in: null-terminated string */
{
ulint
len1
;
ulint
len2
;
char
*
str
;
len1
=
ut_strlen
(
str1
);
len2
=
ut_strlen
(
str2
);
str
=
mem_alloc
(
len1
+
len2
+
1
);
ut_memcpy
(
str
,
str1
,
len1
);
ut_memcpy
(
str
+
len1
,
str2
,
len2
+
1
);
return
(
str
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment