Skip to content

Commit 5165de6

Browse files
authored
Merge pull request #4 from libdriver/dev
fix: fix getopt errors
2 parents 852ddd3 + 58f5620 commit 5165de6

File tree

4 files changed

+32
-40
lines changed

4 files changed

+32
-40
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## 1.0.5 (2025-01-05)
2+
3+
## Features
4+
5+
- fix getopt errors
6+
17
## 1.0.4 (2024-12-28)
28

39
## Features

project/stm32f407/MDK/stm32f407.uvprojx

+4-8
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
<TargetName>stm32f407</TargetName>
1111
<ToolsetNumber>0x4</ToolsetNumber>
1212
<ToolsetName>ARM-ADS</ToolsetName>
13-
<pCCUsed>6140000::V6.14::ARMCLANG</pCCUsed>
13+
<pCCUsed>6220000::V6.22::ARMCLANG</pCCUsed>
1414
<uAC6>1</uAC6>
1515
<TargetOption>
1616
<TargetCommonOption>
1717
<Device>STM32F407ZGTx</Device>
1818
<Vendor>STMicroelectronics</Vendor>
19-
<PackID>Keil.STM32F4xx_DFP.2.14.0</PackID>
20-
<PackURL>http://www.keil.com/pack/</PackURL>
19+
<PackID>Keil.STM32F4xx_DFP.3.0.0</PackID>
20+
<PackURL>https://www.keil.com/pack/</PackURL>
2121
<Cpu>IRAM(0x20000000,0x00020000) IRAM2(0x10000000,0x00010000) IROM(0x08000000,0x00100000) CPUTYPE("Cortex-M4") FPU2 CLOCK(12000000) ELITTLE</Cpu>
2222
<FlashUtilSpec></FlashUtilSpec>
2323
<StartupFile></StartupFile>
@@ -186,6 +186,7 @@
186186
<RvdsVP>2</RvdsVP>
187187
<RvdsMve>0</RvdsMve>
188188
<RvdsCdeCp>0</RvdsCdeCp>
189+
<nBranchProt>0</nBranchProt>
189190
<hadIRAM2>1</hadIRAM2>
190191
<hadIROM2>0</hadIROM2>
191192
<StupSel>8</StupSel>
@@ -984,11 +985,6 @@
984985
<Layers>
985986
<Layer>
986987
<LayName>&lt;Project Info&gt;</LayName>
987-
<LayDesc></LayDesc>
988-
<LayUrl></LayUrl>
989-
<LayKeys></LayKeys>
990-
<LayCat></LayCat>
991-
<LayLic></LayLic>
992988
<LayTarg>0</LayTarg>
993989
<LayPrjMark>1</LayPrjMark>
994990
</Layer>

project/stm32f407/usr/src/getopt.c

+21-31
Original file line numberDiff line numberDiff line change
@@ -180,20 +180,15 @@ static char *my_index (const char *str, int chr);
180180
extern char *getenv ();
181181
#endif
182182

183-
static int
184-
my_strlen (str)
185-
const char *str;
183+
static int my_strlen(const char *str)
186184
{
187185
int n = 0;
188186
while (*str++)
189187
n++;
190188
return n;
191189
}
192190

193-
static char *
194-
my_index (str, chr)
195-
const char *str;
196-
int chr;
191+
static char *my_index(const char *str, int chr)
197192
{
198193
while (*str)
199194
{
@@ -234,12 +229,10 @@ static int last_nonopt;
234229
*/
235230

236231
#if __STDC__ || defined(PROTO)
237-
static void exchange (char **argv);
232+
static void exchange(char **argv);
238233
#endif
239234

240-
static void
241-
exchange (argv)
242-
char **argv;
235+
static void exchange(char **argv)
243236
{
244237
char *temp, **first, **last;
245238

@@ -322,14 +315,13 @@ exchange (argv)
322315
If LONG_ONLY is nonzero, '-' as well as '--' can introduce
323316
long-named options. */
324317

325-
int
326-
_getopt_internal (argc, argv, optstring, longopts, longind, long_only)
327-
int argc;
328-
char *const *argv;
329-
const char *optstring;
330-
const struct option *longopts;
331-
int *longind;
332-
int long_only;
318+
int _getopt_internal(int argc,
319+
char *const *argv,
320+
const char *optstring,
321+
const struct option *longopts,
322+
int *longind,
323+
int long_only
324+
)
333325
{
334326
int option_index;
335327

@@ -656,25 +648,23 @@ _getopt_internal (argc, argv, optstring, longopts, longind, long_only)
656648
}
657649
}
658650

659-
int
660-
getopt (argc, argv, optstring)
661-
int argc;
662-
char *const *argv;
663-
const char *optstring;
651+
int getopt(int argc,
652+
char *const *argv,
653+
const char *optstring
654+
)
664655
{
665656
return _getopt_internal (argc, argv, optstring,
666657
(const struct option *) 0,
667658
(int *) 0,
668659
0);
669660
}
670661

671-
int
672-
getopt_long (argc, argv, options, long_options, opt_index)
673-
int argc;
674-
char *const *argv;
675-
const char *options;
676-
const struct option *long_options;
677-
int *opt_index;
662+
int getopt_long(int argc,
663+
char *const *argv,
664+
const char *options,
665+
const struct option *long_options,
666+
int *opt_index
667+
)
678668
{
679669
return _getopt_internal (argc, argv, options, long_options, opt_index, 0);
680670
}

0 commit comments

Comments
 (0)