Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dyncam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rene Kolling
dyncam
Commits
dc0987ab
Commit
dc0987ab
authored
Apr 2, 2021
by
Rene
Browse files
Options
Downloads
Patches
Plain Diff
Anpassungen der Debug und Error Nachrichten
parent
2bc5c4dd
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
dyncam
+0
-0
0 additions, 0 deletions
dyncam
dyncam.c
+21
-13
21 additions, 13 deletions
dyncam.c
with
21 additions
and
13 deletions
dyncam
+
0
−
0
View file @
dc0987ab
No preview for this file type
This diff is collapsed.
Click to expand it.
dyncam.c
+
21
−
13
View file @
dc0987ab
...
...
@@ -22,6 +22,7 @@ typedef struct
int
width
,
height
;
}
rectangle
;
/* Deklarieren der Funktionen */
extern
void
throwError
(
char
*
errorMSG
);
extern
void
throwWarning
(
char
*
warningMSG
);
#define ERROR throwError
...
...
@@ -103,7 +104,6 @@ int main (int argc, char **argv)
searchForColorRectII
(
searchColor
,
image
,
width
,
height
);
}
image
->
f
.
destroy_image
(
image
);
XDestroyWindow
(
display
,
window
);
XCloseDisplay
(
display
);
...
...
@@ -160,7 +160,7 @@ void evaluateArguments (int argc, char **argv)
pickColor
=
True
;
if
(
lookForColor
)
{
lookForColor
=
False
;
WARN
(
"Pick excludes -f
ou
nd!"
);
WARN
(
"Pick excludes -f
i
nd!"
);
}
if
(
colorParam
)
{
colorParam
=
False
;
...
...
@@ -171,7 +171,7 @@ void evaluateArguments (int argc, char **argv)
if
(
!
strcmp
(
OPTION
,
"-find"
)
||
!
strcmp
(
OPTION
,
"-f"
))
{
if
(
pickColor
)
{
WARN
(
"Pick excludes -f
ou
nd!"
);
WARN
(
"Pick excludes -f
i
nd!"
);
NEXTOPT
;
NEXTOPT
;
continue
;
...
...
@@ -184,11 +184,11 @@ void evaluateArguments (int argc, char **argv)
continue
;
}
else
{
ERROR
(
"-f
ou
nd is missing an argument!"
);
ERROR
(
"-f
i
nd is missing an argument!"
);
}
}
else
{
ERROR
(
"-f
ou
nd is missing an argument!"
);
ERROR
(
"-f
i
nd is missing an argument!"
);
}
}
...
...
@@ -229,7 +229,7 @@ rectangle searchForColorRectII (uint32_t color, XImage *image, unsigned width, u
}
}
if
(
!
foundColor
)
{
ERROR
(
"
Farbe wurde nicht gef
und
en
"
);
ERROR
(
"
Color not fo
und
!
"
);
}
foundColor
=
False
;
...
...
@@ -381,14 +381,18 @@ unsigned long extractHexFromString(char *hexString) {
unsigned
long
result
=
0
;
int
j
=
1
;
int
temp
;
int
temp
=
0
;
for
(
int
i
=
strlen
(
hexString
)
-
1
;
i
>=
0
;
i
--
)
{
if
(
hexString
[
i
]
-
'0'
>
9
)
{
if
(
hexString
[
i
]
>=
'0'
&&
hexString
[
i
]
<=
'9'
)
{
temp
=
hexString
[
i
]
-
'0'
;
}
else
if
(
hexString
[
i
]
>=
'a'
&&
hexString
[
i
]
<=
'f'
)
{
temp
=
hexString
[
i
]
-
'a'
+
10
;
}
else
if
(
hexString
[
i
]
>=
'A'
&&
hexString
[
i
]
<=
'F'
)
{
temp
=
hexString
[
i
]
-
'A'
+
10
;
}
else
{
temp
=
hexString
[
i
]
-
'0'
;
ERROR
(
"wrong Parameter!"
)
;
}
result
+=
temp
*
j
;
j
*=
16
;
...
...
@@ -410,9 +414,13 @@ unsigned long extractIntFromString(char *intString) {
for
(
int
i
=
strlen
(
intString
)
-
1
;
i
>=
0
;
i
--
)
{
if
(
intString
[
i
]
>=
'0'
&&
intString
[
i
]
<=
'9'
)
{
temp
=
intString
[
i
]
-
'0'
;
result
+=
temp
*
j
;
j
*=
10
;
}
else
{
ERROR
(
"wrong Parameter!"
);
}
}
if
(
debug
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment