From 3f3a1341d846fdb36da7eb1b3b51631d2330b732 Mon Sep 17 00:00:00 2001 From: chrislu Date: Fri, 26 Aug 2022 17:09:11 -0700 Subject: [PATCH] make CodeQL happy --- weed/command/volume.go | 6 +++--- weed/server/volume_server.go | 2 +- weed/storage/store.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/weed/command/volume.go b/weed/command/volume.go index 91d9fb925..3ad8ba1bb 100644 --- a/weed/command/volume.go +++ b/weed/command/volume.go @@ -40,7 +40,7 @@ type VolumeServerOptions struct { portGrpc *int publicPort *int folders []string - folderMaxLimits []int + folderMaxLimits []int32 idxFolder *string ip *string publicUrl *string @@ -148,8 +148,8 @@ func (v VolumeServerOptions) startVolumeServer(volumeFolders, maxVolumeCounts, v // set max maxCountStrings := strings.Split(maxVolumeCounts, ",") for _, maxString := range maxCountStrings { - if max, e := strconv.Atoi(maxString); e == nil { - v.folderMaxLimits = append(v.folderMaxLimits, max) + if max, e := strconv.ParseInt(maxString, 10, 64); e == nil { + v.folderMaxLimits = append(v.folderMaxLimits, int32(max)) } else { glog.Fatalf("The max specified in -max not a valid number %s", maxString) } diff --git a/weed/server/volume_server.go b/weed/server/volume_server.go index c337fa740..46bf746f7 100644 --- a/weed/server/volume_server.go +++ b/weed/server/volume_server.go @@ -51,7 +51,7 @@ type VolumeServer struct { func NewVolumeServer(adminMux, publicMux *http.ServeMux, ip string, port int, grpcPort int, publicUrl string, - folders []string, maxCounts []int, minFreeSpaces []util.MinFreeSpace, diskTypes []types.DiskType, + folders []string, maxCounts []int32, minFreeSpaces []util.MinFreeSpace, diskTypes []types.DiskType, idxFolder string, needleMapKind storage.NeedleMapKind, masterNodes []pb.ServerAddress, pulseSeconds int, diff --git a/weed/storage/store.go b/weed/storage/store.go index 643c71c6d..3cb35cb85 100644 --- a/weed/storage/store.go +++ b/weed/storage/store.go @@ -65,7 +65,7 @@ func (s *Store) String() (str string) { return } -func NewStore(grpcDialOption grpc.DialOption, ip string, port int, grpcPort int, publicUrl string, dirnames []string, maxVolumeCounts []int, +func NewStore(grpcDialOption grpc.DialOption, ip string, port int, grpcPort int, publicUrl string, dirnames []string, maxVolumeCounts []int32, minFreeSpaces []util.MinFreeSpace, idxFolder string, needleMapKind NeedleMapKind, diskTypes []DiskType) (s *Store) { s = &Store{grpcDialOption: grpcDialOption, Port: port, Ip: ip, GrpcPort: grpcPort, PublicUrl: publicUrl, NeedleMapKind: needleMapKind} s.Locations = make([]*DiskLocation, 0)