Skip to content

Commit

Permalink
usb-spec: move the opening curly brackets to end of line
Browse files Browse the repository at this point in the history
That's our defined style and that we've been using in the majority of
the codebase.

Disable clang-format on a couple of sections, where it gets a silly
moment and insists on reformatting everything.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
  • Loading branch information
evelikov committed Oct 16, 2024
1 parent f41d657 commit 425f92c
Showing 1 changed file with 14 additions and 20 deletions.
34 changes: 14 additions & 20 deletions usb-spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ struct genericstrtable {

/* ---------------------------------------------------------------------- */

static const struct audioterminal audioterminals[] =
{
static const struct audioterminal audioterminals[] = {
{ 0x0100, "USB Undefined" },
{ 0x0101, "USB Streaming" },
{ 0x01ff, "USB Vendor Specific" },
Expand Down Expand Up @@ -88,8 +87,7 @@ static const struct audioterminal audioterminals[] =
{ 0x0000, NULL },
};

static const struct videoterminal videoterminals[] =
{
static const struct videoterminal videoterminals[] = {
{ 0x0100, "USB Vendor Specific" },
{ 0x0101, "USB Streaming" },
{ 0x0200, "Input Vendor Specific" },
Expand All @@ -105,16 +103,14 @@ static const struct videoterminal videoterminals[] =
{ 0x0000, NULL },
};

static const struct genericstrtable hiddescriptors[] =
{
static const struct genericstrtable hiddescriptors[] = {
{ 0x21, "HID" },
{ 0x22, "Report" },
{ 0x23, "Physical" },
{ 0x00, NULL },
};

static const struct genericstrtable reports[] =
{
static const struct genericstrtable reports[] = {
{ 0x04, "Usage Page" },
{ 0x08, "Usage" },
{ 0x14, "Logical Minimum" },
Expand Down Expand Up @@ -145,8 +141,7 @@ static const struct genericstrtable reports[] =
{ 0x00, NULL },
};

static const struct genericstrtable huts[] =
{
static const struct genericstrtable huts[] = {
{ 0x00, "Undefined" },
{ 0x01, "Generic Desktop Controls" },
{ 0x02, "Simulation Controls" },
Expand Down Expand Up @@ -179,18 +174,19 @@ static const struct genericstrtable huts[] =
{ 0x00, NULL },
};

static const struct genericstrtable biass[] =
{
static const struct genericstrtable biass[] = {
// clang-format off
{ 0x0, "Not Applicable" },
{ 0x1, "Right Hand" },
{ 0x2, "Left Hand" },
{ 0x3, "Both Hands" },
{ 0x4, "Either Hand" },
{ 0x0, NULL },
// clang-format on
};

static const struct genericstrtable physdess[] =
{
static const struct genericstrtable physdess[] = {
// clang-format off
{ 0x00, "None" },
{ 0x01, "Hand" },
{ 0x02, "Eyeball" },
Expand Down Expand Up @@ -232,13 +228,13 @@ static const struct genericstrtable physdess[] =
{ 0x26, "Brow" },
{ 0x27, "Cheek" },
{ 0x00, NULL },
// clang-format on
};

/* HUT usage specs are represented as:
* (huttype << 16) + hutus
*/
static const struct genericstrtable hutus[] =
{
static const struct genericstrtable hutus[] = {
{ (0x01 << 16) + 0x000, "Undefined" },
{ (0x01 << 16) + 0x001, "Pointer" },
{ (0x01 << 16) + 0x002, "Mouse" },
Expand Down Expand Up @@ -1385,8 +1381,7 @@ static const struct genericstrtable hutus[] =
/* dialects are represented as:
* langid + (dialectid << 10)
*/
static const struct genericstrtable langids[] =
{
static const struct genericstrtable langids[] = {
{ 0x0001 + (0x01 << 10), "Saudi Arabia" },
{ 0x0001 + (0x02 << 10), "Iraq" },
{ 0x0001 + (0x03 << 10), "Egypt" },
Expand Down Expand Up @@ -1552,8 +1547,7 @@ static const struct genericstrtable langids[] =
{ 0x0000, NULL },
};

static const struct genericstrtable countrycodes[] =
{
static const struct genericstrtable countrycodes[] = {
{ 0, "Not supported" },
{ 1, "Arabic" },
{ 2, "Belgian" },
Expand Down

0 comments on commit 425f92c

Please sign in to comment.