Args - #59
Open
raykpridgen wants to merge 2 commits into
Open
Conversation
Initial errors / typos Logic changes New parse function: bytes to suffix Testing Changes Updated documentation
raykpridgen
force-pushed
the
args
branch
2 times, most recently
from
July 8, 2026 17:49
7e61235 to
e105312
Compare
raykpridgen
added a commit
to raykpridgen/xdd
that referenced
this pull request
Jul 22, 2026
calccrypto
reviewed
Jul 31, 2026
calccrypto
reviewed
Jul 31, 2026
| int args, i; | ||
| int target_number; | ||
| int args = 0; | ||
| int i; |
calccrypto
reviewed
Jul 31, 2026
calccrypto
reviewed
Jul 31, 2026
calccrypto
reviewed
Jul 31, 2026
|
|
||
| /* The format of the entries in the xdd function table */ | ||
| typedef int (*func_ptr)(xdd_plan_t *planp, int32_t argc, char *argv[], uint32_t flags); | ||
| typedef int (*func_ptr)(xdd_plan_t *planp, int32_t argc, char *argv[], uint32_t flags, int32_t target); |
Collaborator
There was a problem hiding this comment.
add comment saying what return values mean
Open
calccrypto
reviewed
Jul 31, 2026
| int args, args_index; | ||
| int target_number; | ||
| int args = 0; | ||
| int args_index; |
calccrypto
reviewed
Jul 31, 2026
calccrypto
reviewed
Jul 31, 2026
| int args, i; | ||
| int target_number; | ||
| int args = 0; | ||
| int i; |
calccrypto
reviewed
Jul 31, 2026
calccrypto
reviewed
Jul 31, 2026
| int args, i; // Number of args and a counter | ||
| int target_number; // The specific target number to update | ||
| int args = 0; // args | ||
| int i; // counter |
calccrypto
reviewed
Jul 31, 2026
calccrypto
reviewed
Jul 31, 2026
| int args, i; | ||
| int target_number; | ||
| int args = 0; | ||
| int i; |
calccrypto
reviewed
Jul 31, 2026
calccrypto
reviewed
Jul 31, 2026
| int args, i; | ||
| int target_number; | ||
| int args = 0; | ||
| int i; |
calccrypto
reviewed
Jul 31, 2026
calccrypto
reviewed
Jul 31, 2026
Comment on lines
+2573
to
2576
| int args = 0; | ||
| int i; | ||
|
|
||
| target_data_t *tdp; |
calccrypto
reviewed
Jul 31, 2026
calccrypto
reviewed
Jul 31, 2026
calccrypto
reviewed
Jul 31, 2026
Comment on lines
2614
to
2618
| int args = 0; | ||
| int i; | ||
|
|
||
| target_data_t *tdp; | ||
| int64_t numreqs; |
Collaborator
There was a problem hiding this comment.
align or dont; either way clean these up
calccrypto
reviewed
Jul 31, 2026
| { | ||
| int args; | ||
| int target_number; | ||
| int args = 0; |
Collaborator
There was a problem hiding this comment.
is args ever used with a value that is not 0?
calccrypto
reviewed
Jul 31, 2026
calccrypto
reviewed
Jul 31, 2026
calccrypto
reviewed
Jul 31, 2026
calccrypto
reviewed
Jul 31, 2026
calccrypto
reviewed
Jul 31, 2026
| finalize_test 1 "${name} crashed on bad grammar (exit ${rc}): $* (see ${log_file})" | ||
| fi | ||
| } | ||
|
|
Collaborator
There was a problem hiding this comment.
maybe pass in some 0s to make sure you can distinguish between errors and 0 values
raykpridgen
force-pushed
the
args
branch
2 times, most recently
from
August 5, 2026 16:02
d3726e7 to
24311c6
Compare
calccrypto
reviewed
Aug 5, 2026
Comment on lines
+4529
to
+4539
| else if (strtol(argv[1], NULL, 0) < 0) | ||
| { | ||
| fprintf(xgp->errout, | ||
| "%s: ERROR in '%s': number of targets cannnot be negative: %s\n", xgp->progname, argv[0], argv[1]); | ||
| return(-1); | ||
| } | ||
|
|
||
| // Phase 1 | ||
| if (flags & XDD_PARSE_PHASE1) { | ||
| k = planp->number_of_targets; // Keep the current number of targets we have | ||
| planp->number_of_targets = atoi(argv[1]); // get the number of targets to add to the list | ||
| if (planp->number_of_targets < 0) { // Set all the target names to the single name specified | ||
| // Check to see if the target name is actually an "option" - this may be a syntax error on the command line | ||
| if (*argv[2] == '-') { | ||
| status = xdd_check_option(argv[2]); | ||
| if (status != 0) { | ||
| fprintf(xgp->errout,"%s: syntax error in '%s' specification: target name cannot be an xdd 'option': %s\n", | ||
| xgp->progname, argv[0], argv[2]); | ||
| return(-1); | ||
| } | ||
| } | ||
| i = 3; // Set for the return value | ||
| planp->number_of_targets *= -1; // make this a positive number | ||
| planp->number_of_targets += k; // add in the previous number of targets | ||
| for (j=k; j<planp->number_of_targets; j++) { // This will add targets to the end of the current list of targets | ||
| // Call xdd_get_target_datap() for each target and put the same target name in each Target Data | ||
| // Make sure the Target Data for this target exists - if it does not, the xdd_get_target_datap() subroutine will create one | ||
| tdp = xdd_get_target_datap(planp, j, argv[0]); | ||
| if (tdp == NULL) return(-1); | ||
|
|
||
| tdp->td_target_basename = argv[2]; | ||
| if (strcmp(tdp->td_target_basename,"null") == 0) | ||
| tdp->td_target_options |= TO_NULL_TARGET; | ||
| } // end of FOR loop that places a single target name on each of the associated Target Data | ||
| } else { // Set all target names to the appropriate name | ||
| i = 2; // start with the third argument | ||
| planp->number_of_targets += k; // add in the previous number of targets | ||
| for (j=k; j<planp->number_of_targets; j++) { // This will add targets to the end of the current list of targets | ||
| // Make sure the Target Data for this target exists - if it does not, the xdd_get_target_datap() subroutine will create one | ||
| tdp = xdd_get_target_datap(planp, j, argv[0]); | ||
| if (tdp == NULL) return(-1); | ||
| tdp->td_target_basename = argv[i]; | ||
| if (strcmp(tdp->td_target_basename,"null") == 0) | ||
| tdp->td_target_options |= TO_NULL_TARGET; | ||
| i++; | ||
| } | ||
| } | ||
| return(i); | ||
| } else { // Phase 2 we need to figure out how many targets are specified but not to process them | ||
| k = atoi(argv[1]); // get the number of targets to add to the list | ||
| if (k < 0) { // Set all the target names to the single name specified | ||
| i = 3; // Set for the return value | ||
| } else { // Set all target names to the appropriate name | ||
| i = k+2; // start with the third argument | ||
| k = planp->number_of_targets; // current targets | ||
| planp->number_of_targets = atoi(argv[1]); // new targets |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue #58