Skip to content

Yacam update #321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Yacam update #321

wants to merge 10 commits into from

Conversation

galanCA
Copy link
Contributor

@galanCA galanCA commented Jun 16, 2022

Description

Replaces windows file system functions for C standard functions.

Test

The following tests are checked using a breakpoint.

  • ::init
  • ::open
  • ::clrBufIf
  • ::close

The following tests are not stopped during the run test. Thus they are if-out from CSE, until future use.

  • ::write
  • ::create

Author Progress Checklist:

  • Open draft pull request
    • Make title clearly understandable in a standalone change log context
    • Assign yourself the issue
    • Add at least one label (enhancement, bug, or maintenance)
    • Link the issue(s) addressed by this PR (under "Development" in the sidebar menu)
  • Make code changes (if you haven't already)
  • Self-review of code
    • My code follows the style guidelines of this project
    • I have added comments to my code, particularly in hard-to-understand areas
    • I have only committed the necessary changes for this fix or feature
    • I have made corresponding changes to the documentation
    • My changes generate no new warnings
    • I have ensured that my fix is effective or that my feature works as intended by:
      • exercising the code changes in the test framework, and/or
      • manually verifying the changes (as explained in the the pull request description above)
    • My changes pass all local tests
    • My changes successfully passes CI checks
    • Add any unit test for proof and documentation.
    • Merge in main branch and address resulting conflicts and/or test failures.
  • Move pull request out of draft mode and assign reviewers
  • Iterate with reviewers until all changes are approved
    • Make changes in response to reviewer comments
    • Merge in main branch and address resulting conflicts and/or test failures.
    • Re-request review in GitHub

Reviewer Checklist:

  • Read the pull request description
  • Perform a code review on GitHub
  • Confirm all CI checks pass and there are no build warnings
  • Pull, build, and run automated tests locally
  • Perform manual tests of the fix or feature locally
  • Add any review comments, if applicable
  • Submit review in GitHub as either
    • Request changes, or
    • Approve
  • Iterate with author until all changes are approved

@galanCA galanCA self-assigned this Jun 17, 2022
@galanCA galanCA added maintenance multi-platform issues related to compiling / running on non-Windows platforms enhancement and removed maintenance labels Jun 17, 2022
@galanCA galanCA marked this pull request as ready for review August 16, 2022 14:05
@galanCA galanCA requested a review from tanaya-mankad August 16, 2022 14:06
@galanCA galanCA requested a review from nealkruis August 16, 2022 15:00
Copy link
Contributor

@nealkruis nealkruis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needs error tests.

@@ -1819,11 +1819,13 @@ RC WFILE::wf_Close( // Close weather file if open
{
RC rc = RCOK;
if (yac)
{ if ( hdr // if header given
{
#if 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs comments to explain why it's #ifd out.

if (mFh >= 0)
{ if (_lseek( mFh, 0, SEEK_SET) == -1L)
if (mFh)
{ if (fseek( mFh, 0, SEEK_SET) != 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line hit in the tests?

rc = errFl((const char *)MH_I0104); // seek failed, conditionally issue error msg containing "Seek error on"

int nw = ::write( mFh, yc_buf, bufN); // write buffer contents, return -1 or # bytes written. C library function.
int nw = fwrite( yc_buf, sizeof(char), bufN, mFh); // write buffer contents, return -1 or # bytes written. C library function.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this line hit in the tests?

@@ -1040,6 +966,77 @@ RC YACAM::errFlLn( const char *s, ...) // error message "%s in <mWhat> <mPathNam
(char *)MH_I0118, // "%s '%s' (near line %d):\n %s"
mWhat, mPathName ? mPathName : "bug", mLineNo, buf );
}
#if 0 // Methonds not used, but were modified to fit c-style io, not tested. sha d06014d81f75e5ec2b9d4e31750dd0c076afae46
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Spell check
  2. Is "c-style io" the right term?
  3. Do we need the sha here? Generally we only need a sha if we're deleting something.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we settled on not putting SHAs in comments because version control systems are not forever.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's been Chip's argument for a while. I thought that if we did something like this, we'd just mention that last release version where the code appeared.

@@ -88,6 +85,12 @@ class YACAM

int mErOp; // communicates erOp from entry points to error fcns
// note need a data mbr at end due to rcdef.exe deficiency 10-94.

#if 0 // Methonds not used, but were modified to fit c-style io, not tested. sha d06014d81f75e5ec2b9d4e31750dd0c076afae46
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement multi-platform issues related to compiling / running on non-Windows platforms
Projects
Status: To be reviewed by Neal
Development

Successfully merging this pull request may close these issues.

3 participants