Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libdap-chain
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
cellframe
libdap-chain
Commits
65683fd4
Commit
65683fd4
authored
6 years ago
by
Dmitriy A. Gerasimov
Browse files
Options
Downloads
Patches
Plain Diff
[-] Removed boost macros
[-] Particly cleaned up shit from Krasilnikov
parent
4530b818
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dap_chain.c
+8
-13
8 additions, 13 deletions
dap_chain.c
monero_crypto/chacha8.c
+1
-1
1 addition, 1 deletion
monero_crypto/chacha8.c
monero_crypto/warnings.h
+2
-2
2 additions, 2 deletions
monero_crypto/warnings.h
with
11 additions
and
16 deletions
dap_chain.c
+
8
−
13
View file @
65683fd4
...
...
@@ -139,24 +139,21 @@ void dap_chain_save(dap_chain_t * a_chain)
void
dap_chain_file_write
(
dap_chain_block_cache_t
*
l_block_cache
){
if
(
dap_chain_hash_kind_check
(
&
l_block_cache
->
block_hash
,
l_block_cache
->
block
->
header
.
difficulty
)
==
HASH_GOLD
){
fwrite
(
l_block_cache
->
block
->
header
.
size
,
64
,
1
,
my_file_to_wite_gold
);
fwrite
(
l_block_cache
->
block
,
l_block_cache
->
block
->
header
.
size
,
1
,
my_file_to_wite_gold
);
fwrite
(
l_block_cache
->
block
,
l_block_cache
->
block
->
header
.
size
+
sizeof
(
l_block_cache
->
block
->
header
),
1
,
my_file_to_wite_gold
);
blocks_mined_gold
+=
1
;
/*gold_mem=mmap(0, l_block_cache->block->header.size, PROT_WRITE, MAP_SHARED, my_file_to_wite_gold, 0);
memcpy(gold_mem, l_block_cache, l_block_cache->block->header.size);
munmap(gold_mem, l_block_cache->block->header.size);*/
}
else
if
(
dap_chain_hash_kind_check
(
l_block_cache
,
l_block_cache
->
block
->
header
.
difficulty
)
==
HASH_SILVER
){
fwrite
(
l_block_cache
->
block
->
header
.
size
,
64
,
1
,
my_file_to_wite_silver
);
fwrite
(
l_block_cache
->
block
,
l_block_cache
->
block
->
header
.
size
,
1
,
my_file_to_wite_silver
);
else
if
(
dap_chain_hash_kind_check
(
&
l_block_cache
->
block_hash
,
l_block_cache
->
block
->
header
.
difficulty
)
==
HASH_SILVER
){
fwrite
(
l_block_cache
->
block
,
l_block_cache
->
block
->
header
.
size
+
sizeof
(
l_block_cache
->
block
->
header
),
1
,
my_file_to_wite_silver
);
blocks_mined_silver
+=
1
;
/*silver_mem=mmap(0, l_block_cache->block->header.size, PROT_WRITE, MAP_SHARED, my_file_to_wite_silver, 0);
memcpy(silver_mem, l_block_cache, l_block_cache->block->header.size);
munmap(silver_mem, l_block_cache->block->header.size);*/
}
else
{
fwrite
(
l_block_cache
->
block
->
header
.
size
,
64
,
1
,
my_file_to_wite_copper
);
fwrite
(
l_block_cache
->
block
,
l_block_cache
->
block
->
header
.
size
,
1
,
my_file_to_wite_copper
);
fwrite
(
l_block_cache
->
block
,
l_block_cache
->
block
->
header
.
size
+
sizeof
(
l_block_cache
->
block
->
header
),
1
,
my_file_to_wite_copper
);
blocks_mined_copper
+=
1
;
/*copper_mem=mmap(0, l_block_cache->block->header.size, PROT_WRITE, MAP_SHARED, my_file_to_wite_copper, 0);
memcpy(copper_mem, l_block_cache, l_block_cache->block->header.size);
...
...
@@ -187,17 +184,15 @@ void dap_chain_file_open(dap_chain_block_cache_t* last_g, dap_chain_block_cache_
}
else
{
result
=
fread
(
size_of_gold
,
64
,
1
,
my_file_to_wite_gold
);
result
=
fread
(
l_block_gold
,
size_of_gold
,
1
,
my_file_to_wite_gold
);
/* result = fread(l_block_gold, size_of_gold, 1, my_file_to_wite_gold);
while ((l_block_gold->block!=0)&&result!=0){
result
=
fread
(
size_of_gold
,
64
,
1
,
my_file_to_wite_gold
);
result = fread(
my_file_to_wite_gold,
size_of_gold, 64, 1, my_file_to_wite_gold);
if (result!=0){
result
=
fread
(
l_block_gold
,
size_of_gold
,
1
,
my_file_to_wite_gold
);
result = fread(
my_file_to_wite_gold,
l_block_gold, size_of_gold, 1, my_file_to_wite_gold);
}
}
last_g =l_block_gold;
//l_block_gold =
//l_block_gold =
*/
}
...
...
This diff is collapsed.
Click to expand it.
monero_crypto/chacha8.c
+
1
−
1
View file @
65683fd4
...
...
@@ -38,7 +38,7 @@ Public domain.
static
const
char
sigma
[]
=
"expand 32-byte k"
;
DISABLE_GCC_AND_CLANG_WARNING
(
strict
-
aliasing
)
//
DISABLE_GCC_AND_CLANG_WARNING(strict-aliasing)
void
chacha8
(
const
void
*
data
,
size_t
length
,
const
uint8_t
*
key
,
const
uint8_t
*
iv
,
char
*
cipher
)
{
uint32_t
x0
,
x1
,
x2
,
x3
,
x4
,
x5
,
x6
,
x7
,
x8
,
x9
,
x10
,
x11
,
x12
,
x13
,
x14
,
x15
;
...
...
This diff is collapsed.
Click to expand it.
monero_crypto/warnings.h
+
2
−
2
View file @
65683fd4
...
...
@@ -12,7 +12,7 @@
#else
#include
<boost/preprocessor/stringize.hpp>
//
#include <boost/preprocessor/stringize.hpp>
#define PUSH_WARNINGS _Pragma("GCC diagnostic push")
#define POP_WARNINGS _Pragma("GCC diagnostic pop")
...
...
@@ -26,7 +26,7 @@
#define DISABLE_CLANG_WARNING(w)
#endif
#define DISABLE_GCC_AND_CLANG_WARNING(w) _Pragma(BOOST_PP_STRINGIZE(GCC diagnostic ignored BOOST_PP_STRINGIZE(-W##w)))
//
#define DISABLE_GCC_AND_CLANG_WARNING(w) _Pragma(BOOST_PP_STRINGIZE(GCC diagnostic ignored BOOST_PP_STRINGIZE(-W##w)))
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment