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
Show 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
...
...
@@ -33,7 +33,7 @@ ulint
mach_read_from_1
(
/*=============*/
/* out: ulint integer, >= 0, < 256 */
byte
*
b
);
/* in: pointer to byte */
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. */
...
...
@@ -51,7 +51,7 @@ ulint
mach_read_from_2
(
/*=============*/
/* out: ulint integer, >= 0, < 64k */
byte
*
b
);
/* in: pointer to two bytes */
const
byte
*
b
);
/* in: pointer to two bytes */
/************************************************************
The following function is used to convert a 16-bit data item
...
...
@@ -90,7 +90,7 @@ ulint
mach_read_from_3
(
/*=============*/
/* out: ulint integer */
byte
*
b
);
/* in: pointer to 3 bytes */
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. */
...
...
@@ -108,7 +108,7 @@ ulint
mach_read_from_4
(
/*=============*/
/* out: ulint integer */
byte
*
b
);
/* in: pointer to four bytes */
const
byte
*
b
);
/* in: pointer to four bytes */
/*************************************************************
Writes a ulint in a compressed form (1..5 bytes). */
UNIV_INLINE
...
...
@@ -133,7 +133,7 @@ ulint
mach_read_compressed
(
/*=================*/
/* out: read integer */
byte
*
b
);
/* in: pointer to memory from where to read */
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. */
...
...
@@ -151,7 +151,7 @@ dulint
mach_read_from_6
(
/*=============*/
/* out: dulint integer */
byte
*
b
);
/* in: pointer to 6 bytes */
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. */
...
...
@@ -169,7 +169,7 @@ dulint
mach_read_from_7
(
/*=============*/
/* out: dulint integer */
byte
*
b
);
/* in: pointer to 7 bytes */
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. */
...
...
@@ -187,7 +187,7 @@ dulint
mach_read_from_8
(
/*=============*/
/* out: dulint integer */
byte
*
b
);
/* in: pointer to 8 bytes */
const
byte
*
b
);
/* in: pointer to 8 bytes */
/*************************************************************
Writes a dulint in a compressed form (5..9 bytes). */
UNIV_INLINE
...
...
@@ -212,7 +212,7 @@ dulint
mach_dulint_read_compressed
(
/*========================*/
/* out: read dulint */
byte
*
b
);
/* in: pointer to memory from where to read */
const
byte
*
b
);
/* in: pointer to memory from where to read */
/*************************************************************
Writes a dulint in a compressed form (1..11 bytes). */
UNIV_INLINE
...
...
@@ -237,7 +237,7 @@ dulint
mach_dulint_read_much_compressed
(
/*=============================*/
/* out: read dulint */
byte
*
b
);
/* in: pointer to memory from where to read */
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. */
...
...
@@ -267,7 +267,7 @@ double
mach_double_read
(
/*=============*/
/* out: double read */
byte
*
b
);
/* in: pointer to memory from where to 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
...
...
@@ -283,7 +283,7 @@ float
mach_float_read
(
/*============*/
/* out: float read */
byte
*
b
);
/* in: pointer to memory from where to 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
...
...
@@ -299,7 +299,7 @@ ulint
mach_read_from_n_little_endian
(
/*===========================*/
/* out: unsigned long int */
byte
*
buf
,
/* in: from where to read */
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. */
...
...
@@ -317,7 +317,7 @@ ulint
mach_read_from_2_little_endian
(
/*===========================*/
/* out: unsigned long int */
byte
*
buf
);
/* in: from where to read */
const
byte
*
buf
);
/* in: from where to read */
/*************************************************************
Writes a ulint in the little-endian format. */
UNIV_INLINE
...
...
include/mach0data.ic
View file @
7edc6be4
...
...
@@ -29,7 +29,7 @@ ulint
mach_read_from_1(
/*=============*/
/* out: ulint integer, >= 0, < 256 */
byte* b) /* in: pointer to byte */
const
byte* b) /* in: pointer to byte */
{
ut_ad(b);
return((ulint)(b[0]));
...
...
@@ -60,7 +60,7 @@ ulint
mach_read_from_2(
/*=============*/
/* out: ulint integer */
byte* b) /* in: pointer to 2 bytes */
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));
}
/***********************************************************
...
...
@@ -125,7 +125,7 @@ ulint
mach_read_from_3(
/*=============*/
/* out: ulint integer */
byte* b) /* in: pointer to 3 bytes */
const
byte* b) /* in: pointer to 3 bytes */
{
ut_ad(b);
return( ((ulint)(b[0]) << 16)
...
...
@@ -160,7 +160,7 @@ ulint
mach_read_from_4(
/*=============*/
/* out: ulint integer */
byte* b) /* in: pointer to four bytes */
const
byte* b) /* in: pointer to four bytes */
{
ut_ad(b);
return( ((ulint)(b[0]) << 24)
...
...
@@ -235,7 +235,7 @@ ulint
mach_read_compressed(
/*=================*/
/* out: read integer (< 2^32) */
byte* b) /* in: pointer to memory from where to read */
const
byte* b) /* in: pointer to memory from where to read */
{
ulint flag;
...
...
@@ -281,7 +281,7 @@ dulint
mach_read_from_8(
/*=============*/
/* out: dulint integer */
byte* b) /* in: pointer to 8 bytes */
const
byte* b) /* in: pointer to 8 bytes */
{
ulint high;
ulint low;
...
...
@@ -318,7 +318,7 @@ dulint
mach_read_from_7(
/*=============*/
/* out: dulint integer */
byte* b) /* in: pointer to 7 bytes */
const
byte* b) /* in: pointer to 7 bytes */
{
ulint high;
ulint low;
...
...
@@ -355,7 +355,7 @@ dulint
mach_read_from_6(
/*=============*/
/* out: dulint integer */
byte* b) /* in: pointer to 7 bytes */
const
byte* b) /* in: pointer to 7 bytes */
{
ulint high;
ulint low;
...
...
@@ -407,7 +407,7 @@ dulint
mach_dulint_read_compressed(
/*========================*/
/* out: read dulint */
byte* b) /* in: pointer to memory from where to read */
const
byte* b) /* in: pointer to memory from where to read */
{
ulint high;
ulint low;
...
...
@@ -474,7 +474,7 @@ dulint
mach_dulint_read_much_compressed(
/*=============================*/
/* out: read dulint */
byte* b) /* in: pointer to memory from where to read */
const
byte* b) /* in: pointer to memory from where to read */
{
ulint high;
ulint low;
...
...
@@ -503,7 +503,7 @@ double
mach_double_read(
/*=============*/
/* out: double read */
byte* b) /* in: pointer to memory from where to read */
const
byte* b) /* in: pointer to memory from where to read */
{
double d;
ulint i;
...
...
@@ -552,7 +552,7 @@ float
mach_float_read(
/*============*/
/* out: float read */
byte* b) /* in: pointer to memory from where to read */
const
byte* b) /* in: pointer to memory from where to read */
{
float d;
ulint i;
...
...
@@ -601,11 +601,11 @@ ulint
mach_read_from_n_little_endian(
/*===========================*/
/* out: unsigned long int */
byte* buf, /* in: from where to read */
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);
...
...
@@ -666,7 +666,7 @@ ulint
mach_read_from_2_little_endian(
/*===========================*/
/* out: unsigned long int */
byte* buf) /* in: from where to read */
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