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
7edc6be4
Commit
7edc6be4
authored
Sep 26, 2006
by
marko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
branches/zip: Add const qualifiers to the pointer parameters of
mach_read_...() functions. Remove unnecessary casts.
parent
c4e548ce
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
68 deletions
+66
-68
btr/btr0cur.c
btr/btr0cur.c
+4
-4
include/mach0data.h
include/mach0data.h
+29
-29
include/mach0data.ic
include/mach0data.ic
+31
-31
page/page0zip.c
page/page0zip.c
+2
-4
No files found.
btr/btr0cur.c
View file @
7edc6be4
...
...
@@ -4332,11 +4332,11 @@ btr_copy_externally_stored_field_prefix(
memcpy
(
buf
,
data
,
local_len
);
data
+=
local_len
;
space_id
=
mach_read_from_4
(
(
byte
*
)
data
+
BTR_EXTERN_SPACE_ID
);
space_id
=
mach_read_from_4
(
data
+
BTR_EXTERN_SPACE_ID
);
page_no
=
mach_read_from_4
(
(
byte
*
)
data
+
BTR_EXTERN_PAGE_NO
);
page_no
=
mach_read_from_4
(
data
+
BTR_EXTERN_PAGE_NO
);
offset
=
mach_read_from_4
(
(
byte
*
)
data
+
BTR_EXTERN_OFFSET
);
offset
=
mach_read_from_4
(
data
+
BTR_EXTERN_OFFSET
);
return
(
local_len
+
btr_copy_externally_stored_field_prefix_low
(
buf
+
local_len
,
...
...
@@ -4357,7 +4357,7 @@ btr_copy_externally_stored_field(
/*=============================*/
/* out: the whole field copied to heap */
ulint
*
len
,
/* out: length of the whole field */
byte
*
data
,
/* in: 'internally' stored part of the
const
byte
*
data
,
/* in: 'internally' stored part of the
field containing also the reference to
the external part */
ulint
zip_size
,
/* in: nonzero=compressed BLOB page size,
...
...
include/mach0data.h
View file @
7edc6be4
...
...
@@ -32,8 +32,8 @@ UNIV_INLINE
ulint
mach_read_from_1
(
/*=============*/
/* out: ulint integer, >= 0, < 256 */
byte
*
b
);
/* in: pointer to byte */
/* out: ulint integer, >= 0, < 256 */
const
byte
*
b
);
/* in: pointer to byte */
/***********************************************************
The following function is used to store data in two consecutive
bytes. We store the most significant byte to the lower address. */
...
...
@@ -50,8 +50,8 @@ UNIV_INLINE
ulint
mach_read_from_2
(
/*=============*/
/* out: ulint integer, >= 0, < 64k */
byte
*
b
);
/* in: pointer to two bytes */
/* out: ulint integer, >= 0, < 64k */
const
byte
*
b
);
/* in: pointer to two bytes */
/************************************************************
The following function is used to convert a 16-bit data item
...
...
@@ -89,8 +89,8 @@ UNIV_INLINE
ulint
mach_read_from_3
(
/*=============*/
/* out: ulint integer */
byte
*
b
);
/* in: pointer to 3 bytes */
/* out: ulint integer */
const
byte
*
b
);
/* in: pointer to 3 bytes */
/***********************************************************
The following function is used to store data in four consecutive
bytes. We store the most significant byte to the lowest address. */
...
...
@@ -107,8 +107,8 @@ UNIV_INLINE
ulint
mach_read_from_4
(
/*=============*/
/* out: ulint integer */
byte
*
b
);
/* in: pointer to four bytes */
/* out: ulint integer */
const
byte
*
b
);
/* in: pointer to four bytes */
/*************************************************************
Writes a ulint in a compressed form (1..5 bytes). */
UNIV_INLINE
...
...
@@ -132,8 +132,8 @@ UNIV_INLINE
ulint
mach_read_compressed
(
/*=================*/
/* out: read integer */
byte
*
b
);
/* in: pointer to memory from where to read */
/* out: read integer */
const
byte
*
b
);
/* in: pointer to memory from where to read */
/***********************************************************
The following function is used to store data in 6 consecutive
bytes. We store the most significant byte to the lowest address. */
...
...
@@ -150,8 +150,8 @@ UNIV_INLINE
dulint
mach_read_from_6
(
/*=============*/
/* out: dulint integer */
byte
*
b
);
/* in: pointer to 6 bytes */
/* out: dulint integer */
const
byte
*
b
);
/* in: pointer to 6 bytes */
/***********************************************************
The following function is used to store data in 7 consecutive
bytes. We store the most significant byte to the lowest address. */
...
...
@@ -168,8 +168,8 @@ UNIV_INLINE
dulint
mach_read_from_7
(
/*=============*/
/* out: dulint integer */
byte
*
b
);
/* in: pointer to 7 bytes */
/* out: dulint integer */
const
byte
*
b
);
/* in: pointer to 7 bytes */
/***********************************************************
The following function is used to store data in 8 consecutive
bytes. We store the most significant byte to the lowest address. */
...
...
@@ -186,8 +186,8 @@ UNIV_INLINE
dulint
mach_read_from_8
(
/*=============*/
/* out: dulint integer */
byte
*
b
);
/* in: pointer to 8 bytes */
/* out: dulint integer */
const
byte
*
b
);
/* in: pointer to 8 bytes */
/*************************************************************
Writes a dulint in a compressed form (5..9 bytes). */
UNIV_INLINE
...
...
@@ -211,8 +211,8 @@ UNIV_INLINE
dulint
mach_dulint_read_compressed
(
/*========================*/
/* out: read dulint */
byte
*
b
);
/* in: pointer to memory from where to read */
/* out: read dulint */
const
byte
*
b
);
/* in: pointer to memory from where to read */
/*************************************************************
Writes a dulint in a compressed form (1..11 bytes). */
UNIV_INLINE
...
...
@@ -236,8 +236,8 @@ UNIV_INLINE
dulint
mach_dulint_read_much_compressed
(
/*=============================*/
/* out: read dulint */
byte
*
b
);
/* in: pointer to memory from where to read */
/* out: read dulint */
const
byte
*
b
);
/* in: pointer to memory from where to read */
/*************************************************************
Reads a ulint in a compressed form if the log record fully contains it. */
...
...
@@ -266,8 +266,8 @@ UNIV_INLINE
double
mach_double_read
(
/*=============*/
/* out: double read */
byte
*
b
);
/* in: pointer to memory from where to read */
/* out: double read */
const
byte
*
b
);
/* in: pointer to memory from where to read */
/*************************************************************
Writes a double. It is stored in a little-endian format. */
UNIV_INLINE
...
...
@@ -282,8 +282,8 @@ UNIV_INLINE
float
mach_float_read
(
/*============*/
/* out: float read */
byte
*
b
);
/* in: pointer to memory from where to read */
/* out: float read */
const
byte
*
b
);
/* in: pointer to memory from where to read */
/*************************************************************
Writes a float. It is stored in a little-endian format. */
UNIV_INLINE
...
...
@@ -298,9 +298,9 @@ UNIV_INLINE
ulint
mach_read_from_n_little_endian
(
/*===========================*/
/* out: unsigned long int */
byte
*
buf
,
/* in: from where to read */
ulint
buf_size
);
/* in: from how many bytes to read */
/* out: unsigned long int */
const
byte
*
buf
,
/* in: from where to read */
ulint
buf_size
);
/* in: from how many bytes to read */
/*************************************************************
Writes a ulint in the little-endian format. */
UNIV_INLINE
...
...
@@ -316,8 +316,8 @@ UNIV_INLINE
ulint
mach_read_from_2_little_endian
(
/*===========================*/
/* out: unsigned long int */
byte
*
buf
);
/* in: from where to read */
/* out: unsigned long int */
const
byte
*
buf
);
/* in: from where to read */
/*************************************************************
Writes a ulint in the little-endian format. */
UNIV_INLINE
...
...
include/mach0data.ic
View file @
7edc6be4
...
...
@@ -28,8 +28,8 @@ UNIV_INLINE
ulint
mach_read_from_1(
/*=============*/
/* out: ulint integer, >= 0, < 256 */
byte* b) /* in: pointer to byte */
/* out: ulint integer, >= 0, < 256 */
const
byte* b) /* in: pointer to byte */
{
ut_ad(b);
return((ulint)(b[0]));
...
...
@@ -59,8 +59,8 @@ UNIV_INLINE
ulint
mach_read_from_2(
/*=============*/
/* out: ulint integer */
byte* b) /* in: pointer to 2 bytes */
/* out: ulint integer */
const
byte* b) /* in: pointer to 2 bytes */
{
ut_ad(b);
return( ((ulint)(b[0]) << 8)
...
...
@@ -96,7 +96,7 @@ mach_decode_2(
uint16 n) /* in: 16-bit integer in canonical format */
{
ut_ad(2 == sizeof n);
return(mach_read_from_2((byte*) &n));
return(mach_read_from_2((
const
byte*) &n));
}
/***********************************************************
...
...
@@ -124,8 +124,8 @@ UNIV_INLINE
ulint
mach_read_from_3(
/*=============*/
/* out: ulint integer */
byte* b) /* in: pointer to 3 bytes */
/* out: ulint integer */
const
byte* b) /* in: pointer to 3 bytes */
{
ut_ad(b);
return( ((ulint)(b[0]) << 16)
...
...
@@ -159,8 +159,8 @@ UNIV_INLINE
ulint
mach_read_from_4(
/*=============*/
/* out: ulint integer */
byte* b) /* in: pointer to four bytes */
/* out: ulint integer */
const
byte* b) /* in: pointer to four bytes */
{
ut_ad(b);
return( ((ulint)(b[0]) << 24)
...
...
@@ -234,8 +234,8 @@ UNIV_INLINE
ulint
mach_read_compressed(
/*=================*/
/* out: read integer (< 2^32) */
byte* b) /* in: pointer to memory from where to read */
/* out: read integer (< 2^32) */
const
byte* b) /* in: pointer to memory from where to read */
{
ulint flag;
...
...
@@ -280,8 +280,8 @@ UNIV_INLINE
dulint
mach_read_from_8(
/*=============*/
/* out: dulint integer */
byte* b) /* in: pointer to 8 bytes */
/* out: dulint integer */
const
byte* b) /* in: pointer to 8 bytes */
{
ulint high;
ulint low;
...
...
@@ -317,8 +317,8 @@ UNIV_INLINE
dulint
mach_read_from_7(
/*=============*/
/* out: dulint integer */
byte* b) /* in: pointer to 7 bytes */
/* out: dulint integer */
const
byte* b) /* in: pointer to 7 bytes */
{
ulint high;
ulint low;
...
...
@@ -354,8 +354,8 @@ UNIV_INLINE
dulint
mach_read_from_6(
/*=============*/
/* out: dulint integer */
byte* b) /* in: pointer to 7 bytes */
/* out: dulint integer */
const
byte* b) /* in: pointer to 7 bytes */
{
ulint high;
ulint low;
...
...
@@ -406,8 +406,8 @@ UNIV_INLINE
dulint
mach_dulint_read_compressed(
/*========================*/
/* out: read dulint */
byte* b) /* in: pointer to memory from where to read */
/* out: read dulint */
const
byte* b) /* in: pointer to memory from where to read */
{
ulint high;
ulint low;
...
...
@@ -473,8 +473,8 @@ UNIV_INLINE
dulint
mach_dulint_read_much_compressed(
/*=============================*/
/* out: read dulint */
byte* b) /* in: pointer to memory from where to read */
/* out: read dulint */
const
byte* b) /* in: pointer to memory from where to read */
{
ulint high;
ulint low;
...
...
@@ -502,8 +502,8 @@ UNIV_INLINE
double
mach_double_read(
/*=============*/
/* out: double read */
byte* b) /* in: pointer to memory from where to read */
/* out: double read */
const
byte* b) /* in: pointer to memory from where to read */
{
double d;
ulint i;
...
...
@@ -551,8 +551,8 @@ UNIV_INLINE
float
mach_float_read(
/*============*/
/* out: float read */
byte* b) /* in: pointer to memory from where to read */
/* out: float read */
const
byte* b) /* in: pointer to memory from where to read */
{
float d;
ulint i;
...
...
@@ -600,12 +600,12 @@ UNIV_INLINE
ulint
mach_read_from_n_little_endian(
/*===========================*/
/* out: unsigned long int */
byte* buf, /* in: from where to read */
ulint buf_size) /* in: from how many bytes to read */
/* out: unsigned long int */
const
byte* buf, /* in: from where to read */
ulint
buf_size) /* in: from how many bytes to read */
{
ulint n = 0;
byte* ptr;
const
byte* ptr;
ut_ad(buf_size <= sizeof(ulint));
ut_ad(buf_size > 0);
...
...
@@ -665,8 +665,8 @@ UNIV_INLINE
ulint
mach_read_from_2_little_endian(
/*===========================*/
/* out: unsigned long int */
byte* buf) /* in: from where to read */
/* out: unsigned long int */
const
byte* buf) /* in: from where to read */
{
return((ulint)(*buf) + ((ulint)(*(buf + 1))) * 256);
}
...
...
page/page0zip.c
View file @
7edc6be4
...
...
@@ -490,8 +490,7 @@ page_zip_dir_encode(
}
else
{
status
=
REC_STATUS_NODE_PTR
;
if
(
UNIV_UNLIKELY
(
mach_read_from_4
((
page_t
*
)
page
+
FIL_PAGE_PREV
)
==
FIL_NULL
))
{
(
mach_read_from_4
(
page
+
FIL_PAGE_PREV
)
==
FIL_NULL
))
{
min_mark
=
REC_INFO_MIN_REC_FLAG
;
}
}
...
...
@@ -3602,8 +3601,7 @@ page_zip_copy(
+
page_zip
->
m_end
<
page_zip
->
size
);
if
(
!
page_is_leaf
(
src
)
&&
UNIV_UNLIKELY
(
mach_read_from_4
((
byte
*
)
src
+
FIL_PAGE_PREV
)
==
FIL_NULL
)
&&
UNIV_UNLIKELY
(
mach_read_from_4
(
src
+
FIL_PAGE_PREV
)
==
FIL_NULL
)
&&
UNIV_LIKELY
(
mach_read_from_4
(
page
+
FIL_PAGE_PREV
)
!=
FIL_NULL
))
{
/* Clear the REC_INFO_MIN_REC_FLAG of the first user record. */
...
...
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