You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by na...@apache.org on 2020/09/02 13:48:21 UTC

[mynewt-newtmgr] branch master updated: Change MaxRxOff to be a 32-bit integer

This is an automated email from the ASF dual-hosted git repository.

naveenkaje pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-newtmgr.git


The following commit(s) were added to refs/heads/master by this push:
     new 07a1206  Change MaxRxOff to be a 32-bit integer
     new 6925ae6  Merge pull request #172 from rmal30/hotfix/remove-loadint64
07a1206 is described below

commit 07a120619e99f7d616d59efd7f9859e07d93b0d9
Author: Rohan Malik <Ro...@data61.csiro.au>
AuthorDate: Thu Aug 27 15:52:03 2020 +1000

    Change MaxRxOff to be a 32-bit integer
---
 nmxact/xact/image.go | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/nmxact/xact/image.go b/nmxact/xact/image.go
index 653c3c0..a34688d 100644
--- a/nmxact/xact/image.go
+++ b/nmxact/xact/image.go
@@ -65,7 +65,7 @@ type ImageUploadIntTracker struct {
 	WCount   int
 	WCap     int
 	Off      int
-	MaxRxOff int64
+	MaxRxOff int32
 }
 
 type ImageUploadResult struct {
@@ -260,8 +260,8 @@ func (t *ImageUploadIntTracker) HandleResponse(c *ImageUploadCmd, rsp nmp.NmpRsp
 		res.Rsps = append(res.Rsps, irsp)
 		t.UpdateTracker(int(irsp.Off), IMAGE_UPLOAD_STATUS_RQ)
 
-		if t.MaxRxOff < int64(irsp.Off) {
-			t.MaxRxOff = int64(irsp.Off)
+		if t.MaxRxOff < int32(irsp.Off) {
+			t.MaxRxOff = int32(irsp.Off)
 		}
 		if c.ProgressCb != nil {
 			c.ProgressCb(c, irsp)
@@ -329,7 +329,7 @@ func (c *ImageUploadCmd) Run(s sesn.Sesn) (Result, error) {
 		MaxRxOff: 0,
 	}
 
-	for int(atomic.LoadInt64(&t.MaxRxOff)) < len(c.Data) {
+	for int(atomic.LoadInt32(&t.MaxRxOff)) < len(c.Data) {
 		// Block if window is full
 		if !t.CheckWindow() {
 			ch <- 1