Comments (2)
This was intended because I as the programmer do not like changing arguments within a function. I also wanted it to be clear that the dictionary used during computation does not necessarily have to be the same that we got in an argument (it can default to our EN). There is also a point to having this argument as const, because it shows the programmer, that the provided dictionary is not changed and this function indeed treats it like const. I am aware that this variable is omitted during compilation and I deliberately chose to include it nevertheless for the sake of the code.
I will mark this as not a bug, but thank you for the question. I would also like to hear your arguments for removing it because my point of view can be absolutely stupid and it may be irrelevant to most other developers :)
from pa193_mnemonic_bugsbunny.
Indeed, it is only one pointer more in the stack, it is not really important.
In addition, I agree that the it can add more legibility in the code. It is something really interesting because user could think that, if they give a pointer in parameter, and if the pointer is on NULL
, then they would get the default dictionary at the end of the function execution.
For instance :
struct dictionary *dictionary = NULL;
int err = entropy_to_mnemonic(my_dico, entropy, entropy_l, &output);
The function, even if my_dico
is NULL
before, will not change the value of my_dico
.
So, creating a local variable, to show that the dictionary used in the function has not any impact on the arguments, can be useful for beginner.
from pa193_mnemonic_bugsbunny.
Related Issues (8)
- Guys we messed up HOT 2
- Infinite recursion in mnemonic_to_entropy_seed function in mnemonics.c HOT 6
- Potential memory leak in entropy_to_mnemonic function HOT 4
- Impossible to convert from entropy to mnemonic in example.c
- GCC Warning with getopt function in example.c
- Void function with pointers in parameters HOT 2
- Word list too permissive
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pa193_mnemonic_bugsbunny.