Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: media/midi/midi_manager_alsa.cc

Issue 1086693004: [gcc 4.x] Initialize web_port_index to 0 to fix build error while using GCC 4.x toolchain. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/midi/midi_manager_alsa.h" 5 #include "media/midi/midi_manager_alsa.h"
6 6
7 #include <alsa/asoundlib.h> 7 #include <alsa/asoundlib.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 scoped_ptr<MidiPort> port) { 439 scoped_ptr<MidiPort> port) {
440 ports()->push_back(port.Pass()); 440 ports()->push_back(port.Pass());
441 } 441 }
442 442
443 MidiManagerAlsa::MidiPortState::MidiPortState() 443 MidiManagerAlsa::MidiPortState::MidiPortState()
444 : num_input_ports_(0), num_output_ports_(0) { 444 : num_input_ports_(0), num_output_ports_(0) {
445 } 445 }
446 446
447 uint32 MidiManagerAlsa::MidiPortState::Insert(scoped_ptr<MidiPort> port) { 447 uint32 MidiManagerAlsa::MidiPortState::Insert(scoped_ptr<MidiPort> port) {
448 // Add the web midi index. 448 // Add the web midi index.
449 uint32 web_port_index; 449 uint32 web_port_index = 0;
450 switch (port->type()) { 450 switch (port->type()) {
451 case MidiPort::Type::kInput: 451 case MidiPort::Type::kInput:
452 web_port_index = num_input_ports_++; 452 web_port_index = num_input_ports_++;
453 break; 453 break;
454 case MidiPort::Type::kOutput: 454 case MidiPort::Type::kOutput:
455 web_port_index = num_output_ports_++; 455 web_port_index = num_output_ports_++;
456 break; 456 break;
457 } 457 }
458 port->set_web_port_index(web_port_index); 458 port->set_web_port_index(web_port_index);
459 ports()->push_back(port.Pass()); 459 ports()->push_back(port.Pass());
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
1009 // Update our map. 1009 // Update our map.
1010 source_map_[AddrToInt(client_id, port_id)] = port_index; 1010 source_map_[AddrToInt(client_id, port_id)] = port_index;
1011 return true; 1011 return true;
1012 } 1012 }
1013 1013
1014 MidiManager* MidiManager::Create() { 1014 MidiManager* MidiManager::Create() {
1015 return new MidiManagerAlsa(); 1015 return new MidiManagerAlsa();
1016 } 1016 }
1017 1017
1018 } // namespace media 1018 } // namespace media
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698