Merge pull request #889 from Panquesito7/lgtm_fixes

fix: Various LGTM fixes
This commit is contained in:
Ayaan Khan 2020-06-24 02:18:10 +05:30 committed by GitHub
commit 55fe002c10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View File

@ -14,17 +14,17 @@ struct node {
node *right;
};
struct queue {
struct Queue {
node *t[100];
int front;
int rear;
};
queue q;
Queue queue;
void enqueue(node *n) { q.t[q.rear++] = n; }
void enqueue(node *n) { queue.t[queue.rear++] = n; }
node *dequeue() { return (q.t[q.front++]); }
node *dequeue() { return (queue.t[queue.front++]); }
void Insert(node *n, int x) {
if (x < n->val) {
@ -123,8 +123,8 @@ void Post(node *n) {
}
int main() {
q.front = 0;
q.rear = 0;
queue.front = 0;
queue.rear = 0;
int value;
int ch;
node *root = new node;

View File

@ -35,7 +35,7 @@ class stats_computer1 {
n++;
T tmp = x - K;
Ex += tmp;
Ex2 += tmp * tmp;
Ex2 += static_cast<double>(tmp) * tmp;
}
/** return sample mean computed till last sample */

View File

@ -14,7 +14,7 @@ void beadSort(int *a, int len) {
// allocating memory
unsigned char *beads = new unsigned char[max * len];
memset(beads, 0, max * len);
memset(beads, 0, static_cast<size_t>(max) * len);
// mark the beads
for (int i = 0; i < len; i++)