Hi,

On 11/06/2017 12:29 PM, [ext] Jan Kiszka wrote:
On 2017-11-03 16:55, [ext] Andreas J. Reichel wrote:
From: Andreas Reichel <[email protected]>

Store user variable types as uint64_t instead of a string. This enables
the possibility of definint flags. Flags are used to delete a user
variable (to destinguish between setting it empty or removing it) and to
mark variables with special properties. This will be used in a following
commit to define global user variables.

Bits 0..31 are reserved for standard datatype definitions,
bits 32..48 are reserved for user defined datatypes or flags,
bits 49..63 are reserved for internal flags.

Signed-off-by: Andreas Reichel <[email protected]>

...

@@ -367,17 +361,18 @@ static error_t parse_opt(int key, char *arg, struct 
argp_state *state)
static void dump_uservars(uint8_t *udata)
  {
-       char *key, *value, *type;
+       char *key, *value;
+       uint64_t type;
        uint32_t rsize, dsize;
while (*udata) {
                bgenv_map_uservar(udata, &key, &type, (uint8_t **)&value,
                                  &rsize, &dsize);
                printf("%s ", key);
-               if (strcmp(type, USERVAR_TYPE_DEFAULT) == 0) {
+               if ((type & 0x00000000FFFFFFFF) == USERVAR_TYPE_STRING_ASCII) {

Now when I see this I think that might be better and shorter written like this:

    1 << 32 - 1

Haven't done a review of the rest of the code, but that just poped up to my eyes.

Cheers,
Claudius


--
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-54 Fax: (+49)-8142-66989-80 Email: [email protected]

--
You received this message because you are subscribed to the Google Groups "EFI Boot 
Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/44fdd5b2-523d-c4fb-a2ce-01abc8399696%40siemens.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to