Einzelnen Beitrag anzeigen

TurboMagic

Registriert seit: 28. Feb 2016
Ort: Nordost Baden-Württemberg
2.829 Beiträge
 
Delphi 12 Athens
 
#1

Variable nicht initialisiert?

  Alt 14. Nov 2021, 14:50
Hallo,

kann mir mal jemand einen Tipp geben, warum der Compiler hier eine W1036 Warnung,
dass i möglicherweise nicht initialisiert wäre ausgibt?

Delphi-Quellcode:
  procedure encode(data : TBytes);
  var
    i, mod_d, div_d, len_d : UInt64;
    hdata : T128;
  begin
    len_d := length(data);
    if (len_d > 0) then
    begin
      n := 0;
      div_d := len_d div 16;
      if div_d > 0 then
      { TODO : When 6.5 is started the while should be replaced by the for loop again }
      //for i := 0 to div_d -1 do
      i := 0;
// Warnung kommt für diese While Schleife, für das While direkt
      while (i <= div_d -1) do
      begin
        x := poly_mult_H(XOR_PointerWithT128(@data[n], x ));
        inc(n, 16);
        { TODO : Remove the inc when 6.5 implementation starts }
        inc(i);
      end;

      mod_d := len_d mod 16;
      if mod_d > 0 then
      begin
        hdata := nullbytes;
        Move(data[n], hdata[0], mod_d);
        x := poly_mult_H(XOR_T128(hdata, x));
      end;
    end;
  end;
  Mit Zitat antworten Zitat