]> git.sesse.net Git - wloh/commitdiff
sizeof() should be concrete variables when possible.
authorSteinar H. Gunderson <Steinar H. Gunderson sesse@debian.org>
Fri, 16 Mar 2012 23:29:53 +0000 (00:29 +0100)
committerSteinar H. Gunderson <Steinar H. Gunderson sesse@debian.org>
Fri, 16 Mar 2012 23:29:53 +0000 (00:29 +0100)
bayeswf.cpp

index 754955365ac619b6531795be5743e704611df766..f4f52d2aa6e4d3e649dfd189894f7c03f50ce1c8 100644 (file)
@@ -237,8 +237,8 @@ int main(int argc, char **argv)
        for (int j = 0; j < 1000; ++j) {
                float old_mu[MAX_PLAYERS];
                float old_sigma[MAX_PLAYERS];
-               memcpy(old_mu, mu, sizeof(float) * MAX_PLAYERS);
-               memcpy(old_sigma, sigma, sizeof(float) * MAX_PLAYERS);
+               memcpy(old_mu, mu, sizeof(mu));
+               memcpy(old_sigma, sigma, sizeof(sigma));
                for (int i = 0; i < num_players; ++i) {
                        update_mu(mu, sigma, i, matches_for_player[i]);
                        renormalize(mu, sigma, num_players);