This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix handling of discriminantless univariant enums in Rust


>>>>> "Manish" == Manish Goregaokar <manish@mozilla.com> writes:

Manish> Updated. Not sure what the style issues are, could you point them out?

Sure.  There's also the GNU coding standards document, plus some docs on
the gdb wiki somewhere.

Manish>      }
Manish> +  else if (TYPE_NFIELDS (type) == 1) {

Brace placement.  Should line up with that "}" just above.

Manish> +    /* Sometimes univariant enums are encoded without a
Manish> +    discriminant. In that case, treating it as an encoded enum
Manish> +    with the first field being the actual type works.  */

Subsequent text in a multi-line comment should line up under the
"Sometimes".

Period followed by two spaces ends a sentence, so one more space before
"In".

Manish> +    const char* field_name = TYPE_NAME (TYPE_FIELD_TYPE (type, 0));
Manish> +    const char* last = rust_last_path_segment (field_name);

"char *"

Manish> +    ret.name = concat (TYPE_NAME (type), "::", last, (char *) NULL);
Manish> +    ret.field_no = RUST_ENCODED_ENUM_REAL;
Manish> +    ret.is_encoded = 1;
Manish> +    return ret;
Manish> +  }

This brace and the whole block will be indented a bit more due to the
brace placement issue.

thanks,
Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]